18 lines
312 B
GDScript
18 lines
312 B
GDScript
extends EnemyBase
|
|
|
|
|
|
func _ready() -> void:
|
|
super()
|
|
speed = 15.0
|
|
hits_remaining = 2
|
|
$Area2D.body_entered.connect(_on_area_2d_body_entered)
|
|
|
|
func _process(delta: float) -> void:
|
|
if is_dying or is_hurt:
|
|
return
|
|
_chase_witch()
|
|
|
|
func _on_area_2d_body_entered(body: Node2D) -> void:
|
|
if body == player:
|
|
hit()
|