diff --git a/Scenes/Player/player.gd b/Scenes/Player/player.gd index c8a1a97..29c98de 100644 --- a/Scenes/Player/player.gd +++ b/Scenes/Player/player.gd @@ -11,17 +11,16 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: var move_vector: Vector2 = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") - velocity = move_vector * move_speed + velocity = move_vector * move_speed + if velocity == Vector2(0, 0): + $AnimatedSprite2D.stop() if velocity.x > 0: $AnimatedSprite2D.play("move_right") - print(velocity) if velocity.x < 0: $AnimatedSprite2D.play("move_left") - print(velocity) if velocity.y > 0: $AnimatedSprite2D.play("move_down") - print(velocity) if velocity.y < 0: $AnimatedSprite2D.play("move_up") - print(velocity) + move_and_slide()