game: use shader for enemy on-hit visual
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user