aboutsummaryrefslogtreecommitdiff
path: root/examples/game/box.tm
diff options
context:
space:
mode:
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)