Feat/2 weapons foundation #6
@@ -61,15 +61,18 @@ func exit() -> void:
|
|||||||
func update(delta: float) -> void:
|
func update(delta: float) -> void:
|
||||||
elapsed += delta
|
elapsed += delta
|
||||||
if elapsed > params.dash_duration:
|
if elapsed > params.dash_duration:
|
||||||
# Transition to air with preserved velocity (slight decay)
|
|
||||||
machine.player.velocity = direction * _exit_speed * 0.85
|
machine.player.velocity = direction * _exit_speed * 0.85
|
||||||
machine.switch_to("air")
|
if machine.player.is_on_floor():
|
||||||
|
machine.on_ground = true
|
||||||
|
machine.switch_to("ground")
|
||||||
|
else:
|
||||||
|
machine.switch_to("air")
|
||||||
return
|
return
|
||||||
|
|
||||||
# Maintain dash velocity — no gravity, no friction
|
# Maintain dash velocity
|
||||||
machine.player.velocity = direction * _exit_speed
|
var vel = direction * _exit_speed
|
||||||
machine.player.move_and_slide()
|
|
||||||
|
|
||||||
if machine.player.is_on_floor():
|
if machine.player.is_on_floor():
|
||||||
machine.on_ground = true
|
vel.y = -0.5 # Snap to floor to handle ramps
|
||||||
machine.switch_to("ground")
|
|
||||||
|
machine.player.velocity = vel
|
||||||
|
machine.player.move_and_slide()
|
||||||
|
|||||||
Reference in New Issue
Block a user