Browse Source

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.
Luis Henrique Rocha 1 year ago
parent
commit
8fc246a051
1 changed files with 3 additions and 2 deletions
  1. 3 2
      2d/dodge_the_creeps/Player.gd

+ 3 - 2
2d/dodge_the_creeps/Player.gd

@@ -37,11 +37,12 @@ func _process(delta):
 		$AnimatedSprite2D.flip_h = velocity.x < 0
 		$AnimatedSprite2D.flip_h = velocity.x < 0
 	elif velocity.y != 0:
 	elif velocity.y != 0:
 		$AnimatedSprite2D.animation = &"up"
 		$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):
 func start(pos):
 	position = pos
 	position = pos
+	rotation = 0
 	show()
 	show()
 	$CollisionShape2D.disabled = false
 	$CollisionShape2D.disabled = false