Take map as a CLI parameter

This commit is contained in:
Bruce Hill 2024-09-08 19:53:28 -04:00
parent c2f0b7bb95
commit 9f7f4eb858

View File

@ -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)