From 8fc246a051a8f6ccc2fc6565282c27eb03e920bd Mon Sep 17 00:00:00 2001 From: Luis Henrique Rocha Date: Wed, 7 Feb 2024 23:16:03 +0100 Subject: [PATCH] Fix vertical movement sprite in Dodge the Creeps (#1006) Using rotation in the player node instead of flipping vertically, by doing so the trail is also rotated. --- 2d/dodge_the_creeps/Player.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/2d/dodge_the_creeps/Player.gd b/2d/dodge_the_creeps/Player.gd index 5dced369..2621907e 100644 --- a/2d/dodge_the_creeps/Player.gd +++ b/2d/dodge_the_creeps/Player.gd @@ -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