I'm working through the "Your First Game," (Or "Dodge the Creeps," here) tutorial. It seems to be working fine when I test it, until I get the part where the script is supposed to flip the character sprite horizontally and vertically to follow left and right and up and down movement. Then when I run the test the character is initially present in the scene, but disappears when i push any of the arrow keys to move it. If I delete that section of code, it works fine again (except of course the character is back to facing only one direction all the time).
Here's the section of code that's not working:
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
Actually, I just tested it again and now the scene window freezes and stop responding. There's a warning in the debugger saying "Invalid set index 'flip_v' (on base: 'AnimatedSprite') with value of type 'String'. I don't know what this means or how to fix it. Can anyone help me?