add falling sprites

This commit is contained in:
2025-08-30 00:55:58 +01:00
parent cc2eb419ab
commit a6d84f093f
4 changed files with 10654 additions and 5 deletions

View File

@@ -119,22 +119,34 @@ struct
FACING_RIGHT => getWhenJumpingRight (player, amt, rx, ry, ww, wh)
| FACING_LEFT => getWhenJumpingLeft (player, amt, rx, ry, ww, wh)
fun getWhenFalling (player, rx, ry, ww, wh) =
fun getWhenFloating (player, rx, ry, ww, wh) =
case #facing player of
FACING_RIGHT => PlayerJumpRight5.lerp (rx, ry, 3.0, ww, wh)
| FACING_LEFT => PlayerJumpLeft5.lerp (rx, ry, 3.0, ww, wh)
fun getWhenFalling (player, rx, ry, ww, wh) =
case #facing player of
FACING_RIGHT => PlayerFallRight.lerp (rx, ry, 3.0, ww, wh)
| FACING_LEFT => PlayerFallLeft.lerp (rx, ry, 3.0, ww, wh)
fun getWhenDropping (player, rx, ry, ww, wh) =
let val animTimer = #animTimer player
in getWhenJumping (player, animTimer, rx, ry, ww, wh)
let
val animTimer = #animTimer player
in
if animTimer < 15 then
getWhenJumping (player, animTimer, rx, ry, ww, wh)
else
case #facing player of
FACING_RIGHT => PlayerFallRight.lerp (rx, ry, 3.0, ww, wh)
| FACING_LEFT => PlayerFallLeft.lerp (rx, ry, 3.0, ww, wh)
end
fun getWhenNotAttacked (player, rx, ry, ww, wh) =
case #yAxis player of
ON_GROUND => getWhenOnGround (player, rx, ry, ww, wh)
| JUMPING amt => getWhenJumping (player, amt, rx, ry, ww, wh)
| FLOATING _ => getWhenFloating (player, rx, ry, ww, wh)
| FALLING => getWhenFalling (player, rx, ry, ww, wh)
| FLOATING _ => getWhenFalling (player, rx, ry, ww, wh)
| DROP_BELOW_PLATFORM => getWhenDropping (player, rx, ry, ww, wh)
fun getWhenAttacked (player, amt, rx, ry, ww, wh) =
@@ -146,7 +158,18 @@ struct
(* todo: hurt sprite/animation if amt mod 5 = 0 then *)
PlayerStandingLeft.lerp (rx, ry, 3.0, ww, wh)
fun helpGet (player: player, x, y, xOffset, yOffset, ratio, rx, ry, windowWidth, windowHeight) =
fun helpGet
( player: player
, x
, y
, xOffset
, yOffset
, ratio
, rx
, ry
, windowWidth
, windowHeight
) =
case #mainAttack player of
MAIN_ATTACKING {animTimer = amt, ...} =>
(case #facing player of

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -139,12 +139,14 @@ in
fcore/level/player/sprites/jump/player-jump-right-3.sml
fcore/level/player/sprites/jump/player-jump-right-4.sml
fcore/level/player/sprites/jump/player-jump-right-5.sml
fcore/level/player/sprites/jump/player-fall-right.sml
fcore/level/player/sprites/jump/player-jump-left-1.sml
fcore/level/player/sprites/jump/player-jump-left-2.sml
fcore/level/player/sprites/jump/player-jump-left-3.sml
fcore/level/player/sprites/jump/player-jump-left-4.sml
fcore/level/player/sprites/jump/player-jump-left-5.sml
fcore/level/player/sprites/jump/player-fall-left.sml
fcore/level/player/player-vec.sml
end