adjusted springs and player physics
This commit is contained in:
parent
58807ec142
commit
cbbf55a48a
4 changed files with 38 additions and 20 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue