bug fixes
This commit is contained in:
@@ -490,7 +490,11 @@ func _apply_tint(tint_hex: String):
|
||||
fallback_sprite.modulate = tint_color
|
||||
|
||||
func play_hurt_effect():
|
||||
"""Flash mob red briefly to show damage"""
|
||||
"""Play hurt animation and flash mob red briefly to show damage"""
|
||||
# Try to play hurt animation if available
|
||||
if _animated_sprite and _animated_sprite.sprite_frames:
|
||||
_play_animation("hurt", _facing_direction)
|
||||
|
||||
var sprite_to_flash = _animated_sprite if _animated_sprite and _animated_sprite.visible else fallback_sprite
|
||||
|
||||
if not sprite_to_flash:
|
||||
@@ -512,15 +516,17 @@ func play_death_animation():
|
||||
_current_state = "dead"
|
||||
|
||||
if _animated_sprite and _animated_sprite.sprite_frames:
|
||||
# Try to play death animation
|
||||
# Try to play death animation using the standard animation search
|
||||
var frames = _animated_sprite.sprite_frames
|
||||
var death_anim_name = ""
|
||||
|
||||
# Try different death animation names
|
||||
# Try different death animation names with direction
|
||||
var names_to_try = [
|
||||
"dead_%s" % _facing_direction,
|
||||
"dead",
|
||||
"dead_%s" % _alt_direction(_facing_direction),
|
||||
"death_%s" % _facing_direction,
|
||||
"death_%s" % _alt_direction(_facing_direction),
|
||||
"dead",
|
||||
"death"
|
||||
]
|
||||
|
||||
@@ -531,6 +537,7 @@ func play_death_animation():
|
||||
|
||||
if death_anim_name != "":
|
||||
# Play the death animation
|
||||
_last_animation = death_anim_name
|
||||
_animated_sprite.play(death_anim_name)
|
||||
|
||||
# Wait for animation to finish
|
||||
|
||||
Reference in New Issue
Block a user