Feat/2 weapons foundation #6
@@ -79,6 +79,8 @@ func update(delta: float) -> void:
|
||||
vel.y -= params.gravity * delta
|
||||
else:
|
||||
# Snap to floor: small downward velocity keeps is_on_floor() stable
|
||||
# ONLY if we aren't being launched upward by an impulse!
|
||||
if vel.y <= 0.0:
|
||||
vel.y = -0.5
|
||||
|
||||
player.velocity = vel
|
||||
@@ -93,8 +95,9 @@ func update(delta: float) -> void:
|
||||
else:
|
||||
machine.on_ground = false
|
||||
|
||||
# ── Falling off ledge → air state ─────────────────────────────────────
|
||||
if not machine.on_ground and machine.coyote_timer <= 0.0:
|
||||
# ── Launch or Falling off ledge → air state ───────────────────────────
|
||||
if not machine.on_ground:
|
||||
if player.velocity.y > 0.0 or machine.coyote_timer <= 0.0:
|
||||
machine.switch_to("air")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user