Skip to content

Commit

Permalink
Fix vertical movement sprite in Dodge the Creeps (#1006)
Browse files Browse the repository at this point in the history
Using rotation in the player node instead of flipping vertically, by doing so the trail is also rotated.
  • Loading branch information
coruja182 authored Feb 7, 2024
1 parent f954d78 commit 8fc246a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 2d/dodge_the_creeps/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ func _process(delta):
$AnimatedSprite2D.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite2D.animation = &"up"
$AnimatedSprite2D.flip_v = velocity.y > 0
$Trail.rotation = PI if velocity.y > 0 else 0
rotation = PI if velocity.y > 0 else 0


func start(pos):
position = pos
rotation = 0
show()
$CollisionShape2D.disabled = false

Expand Down

1 comment on commit 8fc246a

@CutyDragon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Please sign in to comment.