add 'newKeys' field (list of key codes pressed in frame) to frame input type, so we can change key bindings at runtime later

This commit is contained in:
2025-02-21 11:57:29 +00:00
parent 603d6fa139
commit 40fff7729f
4 changed files with 22 additions and 43 deletions

View File

@@ -8,5 +8,6 @@ struct
, attackHeld: bool
, jumpHeld: bool
, escapeHeld: bool
, newKeys: CoreKey.key_code list
}
end

View File

@@ -190,7 +190,7 @@ struct
else
helpGetMainAttackPatches (attackHeld, mainAttackPressed, charge, acc)
fun getInputPatches (player: player, input) =
fun getInputPatches (player: player, input: FrameInputType.t) =
let
val
{ x
@@ -206,15 +206,8 @@ struct
, ...
} = player
val
{ leftHeld
, rightHeld
, upHeld
, downHeld
, attackHeld
, jumpHeld
, escapeHeld
} = input
val {leftHeld, rightHeld, upHeld, downHeld, attackHeld, jumpHeld, ...} =
input
val xAxis = getXAxis (leftHeld, rightHeld)
val facing = getFacing (facing, xAxis)