summaryrefslogtreecommitdiff
path: root/src/world.moon
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2025-01-21 16:03:25 -0600
committerAlexander M Pickering <alex@cogarr.net>2025-01-21 16:03:25 -0600
commit89a8f94ac0206412c1a2d7b8766d97dbdbd36253 (patch)
treec9ddc23d31d3c5058d3465dabb68aae7b8209138 /src/world.moon
parent0370d64b3bd7914be55358817e52bbc8a529a7d3 (diff)
downloadggj25-89a8f94ac0206412c1a2d7b8766d97dbdbd36253.tar.gz
ggj25-89a8f94ac0206412c1a2d7b8766d97dbdbd36253.tar.bz2
ggj25-89a8f94ac0206412c1a2d7b8766d97dbdbd36253.zip
work
Diffstat (limited to 'src/world.moon')
-rw-r--r--src/world.moon19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/world.moon b/src/world.moon
index 2862a97..6a0eed8 100644
--- a/src/world.moon
+++ b/src/world.moon
@@ -12,13 +12,30 @@ x = {
world_x: 0
world_y: 0
-- Have we selected an input type yet?
- controller_selected: false
+ controller: {
+ text_size: 4
+ }
-- Level information
level: {
graphics:{}
entities:{}
graphic_world: hc.new(5)
}
+ sync_time: () ->
+ am.current_time!
}
x.level.collider = x.level.graphic_world\rectangle(0,0,1,1/win.width)
+
+class GraphicsComponent extends ecs.Component
+ new: (name, properties) =>
+ print("Got name", name, "and properties", properties)
+ assert(properties and properties.node , "Failed to find node for graphics component")
+ super(name, properties)
+ x.node\append(properties.node)
+ static: () =>
+ @@static
+ node: () =>
+ @properties.node
+
+x.GraphicsComponent = GraphicsComponent
x