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