game: use shader for enemy on-hit visual

This commit is contained in:
2025-08-21 00:58:58 +02:00
parent c8340efc95
commit 632643a130
5 changed files with 30 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ extends CharacterBody2D
@onready var nav_agent: NavigationAgent2D = $NavigationAgent2D
@onready var collision_shape_2d: CollisionShape2D = $CollisionShape2D
@onready var shape_cast_2d: ShapeCast2D = $ShapeCast2D
@onready var sprite_2d: Sprite2D = $Sprite2D
var player: Player
var target: Node2D
@@ -27,6 +28,7 @@ func _ready() -> void:
health = max_health
shape_cast_2d.shape.radius = collision_shape_2d.shape.radius
shape_cast_2d.enabled = false
sprite_2d.material = sprite_2d.material.duplicate()
_find_player()