successfully parse controls from file (but todo: save controls imperative shell on load)

This commit is contained in:
2025-02-17 03:48:31 +00:00
parent 46c713a9b5
commit 18495a0cca
5 changed files with 43 additions and 23 deletions

View File

@@ -265,7 +265,20 @@ struct
| true => Glfw.terminate ()
fun loop window =
let val shellState = create window
in helpLoop (shellState, GameType.initial)
let
val shellState = create window
val controls =
case ParseControls.parse () of
SOME controls => controls
| NONE =>
{ left = CoreKey.KEY_LEFT
, right = CoreKey.KEY_RIGHT
, up = CoreKey.KEY_UP
, down = CoreKey.KEY_DOWN
, jump = CoreKey.KEY_Z
, attack = CoreKey.KEY_X
}
in
helpLoop (shellState, GameType.initial controls)
end
end