remove some references to charging when/ife we don't need it, and also only trigger throw/attack on new button press (if held, throw/attack is not repeated)

This commit is contained in:
2025-02-07 12:32:38 +00:00
parent 283962c176
commit 7734496a8c
3 changed files with 37 additions and 48 deletions

View File

@@ -11,6 +11,7 @@ sig
| W_X of int
| W_Y of int
| W_JUMP_PRESSED of bool
| W_MAIN_ATTACK_PRESSED of bool
| W_ENEMIES of GameType.defeated_enemies vector
| W_CHARGE of int
| W_PROJECTILES of GameType.player_projectile vector
@@ -33,6 +34,7 @@ struct
| W_X of int
| W_Y of int
| W_JUMP_PRESSED of bool
| W_MAIN_ATTACK_PRESSED of bool
| W_ENEMIES of GameType.defeated_enemies vector
| W_CHARGE of int
| W_PROJECTILES of GameType.player_projectile vector
@@ -273,6 +275,24 @@ struct
, projectiles
, platID
)
| W_MAIN_ATTACK_PRESSED mainAttackPressed =>
mkPlayer
( health
, xAxis
, yAxis
, x
, y
, jumpPressed
, recoil
, attacked
, mainAttack
, facing
, mainAttackPressed
, enemies
, charge
, projectiles
, platID
)
| W_ENEMIES enemies =>
mkPlayer
( health