Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created October 11, 2021 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/e8b75475b5eb001275abacd25775bdc8 to your computer and use it in GitHub Desktop.
Save flushpot1125/e8b75475b5eb001275abacd25775bdc8 to your computer and use it in GitHub Desktop.
# Gist does not work syntax highlights for ".gd" extention files. ".cs" is dummy extention.
func _physics_process(delta):
if vel.x > 0:
$AnimatedSprite.animation = "walk"
elif vel.x < 0:
$AnimatedSprite.animation = "walk_back"
if vel.length() > 0:
$AnimatedSprite.play()
else:
$AnimatedSprite.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment