Player changes + projectile fixes

This commit is contained in:
dingo
2026-01-19 15:21:56 -05:00
parent 88737d51c4
commit cefa1cf716
9 changed files with 92 additions and 32 deletions
+19 -1
View File
@@ -483,8 +483,26 @@ func _update_fallback_state(state: String):
func _apply_tint(tint_hex: String):
var tint_color = Color.from_string(tint_hex, Color.WHITE)
if _animated_sprite:
_animated_sprite.modulate = tint_color
elif fallback_sprite:
fallback_sprite.modulate = tint_color
func play_hurt_effect():
"""Flash mob red briefly to show damage"""
var sprite_to_flash = _animated_sprite if _animated_sprite and _animated_sprite.visible else fallback_sprite
if not sprite_to_flash:
return
# Store original color
var original_color = sprite_to_flash.modulate
# Flash red
sprite_to_flash.modulate = Color(1.5, 0.5, 0.5, 1.0) # Bright red flash
# Return to original color after 0.1 seconds
await get_tree().create_timer(0.1).timeout
if is_instance_valid(sprite_to_flash):
sprite_to_flash.modulate = original_color