aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-08 19:53:28 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-08 19:53:28 -0400
commit9f7f4eb858d723b0d4fc954b1575feb05f0f8134 (patch)
tree65fd63ba719ed4d4678300f2f1e469c4fedcd0ea /examples
parentc2f0b7bb95cded4dfecf019dd59ca1c6b7777bd3 (diff)
Take map as a CLI parameter
Diffstat (limited to 'examples')
-rw-r--r--examples/game/game.tm8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/game/game.tm b/examples/game/game.tm
index 368d17af..362eae04 100644
--- a/examples/game/game.tm
+++ b/examples/game/game.tm
@@ -6,14 +6,14 @@ use file
use ./world.tm
-func main():
+func main(map="map.txt"):
extern InitWindow:func(w:Int32, h:Int32, title:CString)->Void
InitWindow(1600, 900, "raylib [core] example - 2d camera")
- map := when read("map.txt") is Success(m): m
- else: exit(code=1, "Could not find the game map!")
+ map_contents := when read(map) is Success(m): m
+ else: exit(code=1, "Could not find the game map: $map")
- World.CURRENT:load_map(map)
+ World.CURRENT:load_map(map_contents)
extern SetTargetFPS:func(fps:Int32)
SetTargetFPS(60)