Player changes + projectile fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user