aboutsummaryrefslogtreecommitdiff
path: root/examples/game/box.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-08 19:49:47 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-08 19:49:47 -0400
commita7ae25ec086117e133b2dfbbc1c5025aa2f29964 (patch)
tree45bcab3728e0998205e280a0dd84a44bcb2925be /examples/game/box.tm
parentf86cc6549ff6075c3963fce819391d8d8d6960dc (diff)
Add example game using raylib
Diffstat (limited to 'examples/game/box.tm')
-rw-r--r--examples/game/box.tm9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/game/box.tm b/examples/game/box.tm
new file mode 100644
index 00000000..88713154
--- /dev/null
+++ b/examples/game/box.tm
@@ -0,0 +1,9 @@
+# Defines a struct representing boxes on the terrain
+use vectors
+
+use ./world.tm
+use ./color.tm
+
+struct Box(pos:Vec2, size=Vec2(50, 50), color=Color.GRAY, blocking=yes):
+ func draw(b:&Box):
+ b.color:draw_rectangle(b.pos, b.size)