aboutsummaryrefslogtreecommitdiff
path: root/examples/game
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-01 14:05:10 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-01 14:05:10 -0400
commit4d59fc2987e52da0274e6b204a9d2885613f74b7 (patch)
tree8c262f99cb6ae9b550b9f8abf0ab0477044d087a /examples/game
parent7a2c99de74f5870e1dea5b59d049678ad0ef8e44 (diff)
Move patterns into a module
Diffstat (limited to 'examples/game')
-rw-r--r--examples/game/world.tm4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/game/world.tm b/examples/game/world.tm
index 58fcd4fa..809f1f80 100644
--- a/examples/game/world.tm
+++ b/examples/game/world.tm
@@ -68,8 +68,8 @@ struct World(player:@Player, goal:@Box, boxes:@[@Box], dt_accum=Num32(0.0), won=
DrawText(CString("WINNER"), GetScreenWidth()/Int32(2)-Int32(48*3), GetScreenHeight()/Int32(2)-Int32(24), 48, Color(0,0,0))
func load_map(w:@World, map:Text):
- if map:has($/[]/):
- map = map:replace_all({$/[]/="#", $/@{1..}/="@", $/ /=" "})
+ if map:has("[]"):
+ map = map:translate({"[]"="#", "@ "="@", " "=" "})
w.boxes = @[:@Box]
box_size := Vector2(50., 50.)
for y,line in map:lines():