fix: change to elif for diagonal movement;

This commit is contained in:
2026-08-18 11:02:41 +02:00
parent 1146811e15
commit c93c391c0a
6 changed files with 5 additions and 5 deletions
Vendored
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -4
View File
@@ -14,13 +14,13 @@ func _process(delta: float) -> void:
velocity = move_vector * move_speed velocity = move_vector * move_speed
if velocity == Vector2(0, 0): if velocity == Vector2(0, 0):
$AnimatedSprite2D.stop() $AnimatedSprite2D.stop()
if velocity.x > 0: elif velocity.x > 0:
$AnimatedSprite2D.play("move_right") $AnimatedSprite2D.play("move_right")
if velocity.x < 0: elif velocity.x < 0:
$AnimatedSprite2D.play("move_left") $AnimatedSprite2D.play("move_left")
if velocity.y > 0: elif velocity.y > 0:
$AnimatedSprite2D.play("move_down") $AnimatedSprite2D.play("move_down")
if velocity.y < 0: elif velocity.y < 0:
$AnimatedSprite2D.play("move_up") $AnimatedSprite2D.play("move_up")
move_and_slide() move_and_slide()