aboutsummaryrefslogtreecommitdiff
path: root/examples/game/game.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-15 16:29:45 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-15 16:29:45 -0400
commitfb37b0ee4253651cab10b41cc2e1f536b17b26d4 (patch)
tree30942d2d3d8f5781fffcc0d35733b698bbd43b14 /examples/game/game.tm
parent2b454d1408846fe8ea31c3dce1551d8ebffa8d0d (diff)
Fix up `if var := ...:` in ternary expressions and optional checking
logic
Diffstat (limited to 'examples/game/game.tm')
-rw-r--r--examples/game/game.tm6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/game/game.tm b/examples/game/game.tm
index 362eae04..c7020f55 100644
--- a/examples/game/game.tm
+++ b/examples/game/game.tm
@@ -2,15 +2,15 @@
use libraylib.so
use <raylib.h>
use <raymath.h>
-use file
use ./world.tm
-func main(map="map.txt"):
+func main(map=(./map.txt)):
extern InitWindow:func(w:Int32, h:Int32, title:CString)->Void
InitWindow(1600, 900, "raylib [core] example - 2d camera")
- map_contents := when read(map) is Success(m): m
+ map_contents := if contents := map:read():
+ contents
else: exit(code=1, "Could not find the game map: $map")
World.CURRENT:load_map(map_contents)