fix modules

This commit is contained in:
2025-11-24 23:09:51 -06:00
parent a5fc1c0f3d
commit b7616c61e2
2 changed files with 13 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
var math = use('math')
var color = use('color')
var gamestate = use('gamestate')
var prosperon = use('prosperon')
var draw = {}
@@ -217,9 +217,9 @@ draw.grid = function grid(rect, spacing, thickness = 1, offset = {x: 0, y: 0}, m
draw.scissor = function(rect)
{
var screen_rect = null
if (rect && gamestate.camera) {
var bottom_left = gamestate.camera.world_to_window(rect.x, rect.y)
var top_right = gamestate.camera.world_to_window(rect.x + rect.width, rect.y + rect.height)
if (rect && prosperon.camera) {
var bottom_left = prosperon.camera.world_to_window(rect.x, rect.y)
var top_right = prosperon.camera.world_to_window(rect.x + rect.width, rect.y + rect.height)
var screen_left = bottom_left.x
var screen_top = bottom_left.y
var screen_right = top_right.x
@@ -233,7 +233,7 @@ draw.scissor = function(rect)
}
// TODO: must be a better way than manually inverting here. Some camera specific function.
var sensor = gamestate.camera.sensor()
var sensor = prosperon.camera.sensor()
screen_rect.y = sensor.height - screen_rect.y - screen_rect.height
}

8
point.cm Normal file
View File

@@ -0,0 +1,8 @@
var point = {}
point.add = function(a,b)
{
return {x: a.x+b.x, y: a.y+b.y}
}
return point