So, I started to learn the Godot Game Engine and picked the "Your First Game" tutorial, (link: http://docs.godotengine.org/en/latest/getting_started/step_by_step/your_first_game.html) specifically speaking, the "Choosing Animations" part. This is the code they give:
if velocity.x != 0:
$AnimatedSprite.animation = "right"
$AnimatedSprite.flip_v = false
$AnimatedSprite.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite.animation = "up"
$AnimatedSprite.flip_v = velocity.y > 0
What I got is that when pressing the "up" or "down" key, the sprite disappeared but moved until pressing "left" or "right", that's when it reappeared. I also noticed it doesn't flip vertically.
I fixed the missing sprite problem, like this:
if velocity.x != 0:
$AnimatedSprite.animation = "right"
$AnimatedSprite.flip_v = false
$AnimatedSprite.flip_h = velocity.x < 0
elif velocity.x != 0:
$AnimatedSprite.animation = "up"
$AnimatedSprite.flip_v = velocity.y > 0
But there is one issue remaining, it doesn't change vertically. Is there another way to fix this?