add ability to charge for attack

This commit is contained in:
2024-12-31 10:04:40 +00:00
parent eacc68e80e
commit f199da790d
4 changed files with 81 additions and 87 deletions

View File

@@ -7,6 +7,7 @@ struct
, upHeld = ref false
, downHeld = ref false
, attackHeld = ref false
, chargeHeld = ref false
, width = ref (1920.0 : Real32.real)
, height = ref (1080.0 : Real32.real)
}
@@ -17,6 +18,7 @@ struct
, upHeld = !(#upHeld state)
, downHeld = !(#downHeld state)
, attackHeld = !(#attackHeld state)
, chargeHeld = !(#chargeHeld state)
}
fun getWidth () =
@@ -51,6 +53,10 @@ struct
if action = PRESS then (#attackHeld state) := true
else if action = RELEASE then (#attackHeld state) := false
else ()
else if key = KEY_L then
if action = PRESS then (#chargeHeld state) := true
else if action = RELEASE then (#chargeHeld state) := false
else ()
else
()