adjusted springs and player physics

This commit is contained in:
pennyrigate 2025-03-01 19:03:39 -05:00
parent 58807ec142
commit cbbf55a48a
4 changed files with 38 additions and 20 deletions

View file

@ -14,5 +14,9 @@ func _process(delta: float) -> void:
func _on_area_2d_body_entered(body: Node2D) -> void:
if body is Player:
body.velocity.y = -bounce_power
if body.velocity.y == 0:
body.velocity.x = (body.jump_force * 1.5) * sign(-body.velocity.x)
else:
body.velocity.y = (body.jump_force * 1.5) * sign(-body.velocity.y)
body.velocity.x += body.graphics.scale.x * 20.0
%AnimationPlayer.play("bounce")