feat: animations working

This commit is contained in:
Gerard Gascón 2025-04-12 17:12:04 +02:00
parent 2a9e824a9e
commit 2445a71f0c
63 changed files with 3023 additions and 1408 deletions

View file

@ -18,7 +18,7 @@ func dress(properties: DragonProperties):
_set_dress(shirt, shirt_outfits.get_texture(properties.shirt))
_set_dress(decor, decor_outfits.get_texture(properties.decor))
_set_dress(color, color_outfits.get_texture(properties.color))
play_idle()
play_walk()
func _set_dress(part: AnimatedSprite2D, dress: SpriteFrames):
@ -30,19 +30,19 @@ func _set_dress(part: AnimatedSprite2D, dress: SpriteFrames):
func walk_left():
$Sprite.scale.x = 1
$DragonBody.scale.x = 1
$Dragon.scale.x = 1
func walk_right():
$Sprite.scale.x = -1
$DragonBody.scale.x = -1
$Dragon.scale.x = -1
func _play_animation(animation_name: String, part: AnimatedSprite2D) -> void:
if !part.is_visible():
return
print(part)
part.play(animation_name)
print(part.is_playing())
func play_idle() -> void: