extends CharacterBody2D
@onready var animated_sprite = $AnimatedSprite2D
var speed = 1500
var directions = Input.get_vector(“move_left”, “move_right”, “move_up”, “move_down”)
func _physics_process(delta):
velocity.x = 0
velocity.y = 0
if Input.is_action_pressed("move_left"):
velocity.x += speed * delta
animated_sprite.play("GoLeft")
if Input.is_action_pressed("move_right"):
velocity.x += speed * delta
animated_sprite.play("GoRight")
if Input.is_action_pressed("move_up"):
velocity.x += speed * delta
animated_sprite.play("GoUp")
if Input.is_action_pressed("move_down"):
velocity.x += speed * delta
animated_sprite.play("GoDown")
if velocity.x == 0 and velocity.y == 0:
animated_sprite.play("respiration")
move_and_slide()
pass