fix: change to elif for diagonal movement;
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -14,13 +14,13 @@ func _process(delta: float) -> void:
|
||||
velocity = move_vector * move_speed
|
||||
if velocity == Vector2(0, 0):
|
||||
$AnimatedSprite2D.stop()
|
||||
if velocity.x > 0:
|
||||
elif velocity.x > 0:
|
||||
$AnimatedSprite2D.play("move_right")
|
||||
if velocity.x < 0:
|
||||
elif velocity.x < 0:
|
||||
$AnimatedSprite2D.play("move_left")
|
||||
if velocity.y > 0:
|
||||
elif velocity.y > 0:
|
||||
$AnimatedSprite2D.play("move_down")
|
||||
if velocity.y < 0:
|
||||
elif velocity.y < 0:
|
||||
$AnimatedSprite2D.play("move_up")
|
||||
|
||||
move_and_slide()
|
||||
|
||||
Reference in New Issue
Block a user