Skip to content

Commit

Permalink
Bit of clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
may-20i committed Jan 26, 2024
1 parent e50d15f commit f3a72d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ func _process(delta):

func _physics_process(delta):
var direction = get_input()

if direction.length() > 0:
velocity = velocity.lerp(direction.normalized() * speed, acceleration)
else:
velocity = velocity.lerp(Vector2.ZERO, friction)

move_and_slide()

0 comments on commit f3a72d1

Please sign in to comment.