This commit is contained in:
2026-01-21 23:40:20 +01:00
commit d1f8068081
478 changed files with 24902 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
extends EnemyState
const maxFollowDistance: float = 12.5
func Enter():
if enemy_ref.spiderLight:
enemy_ref.spiderLight.visible = true
if enemy_ref.hitBoxTeeth:
enemy_ref.hitBoxTeeth.active = true
func Exit():
enemy_ref.can_move = true
if enemy_ref.spiderLight:
enemy_ref.spiderLight.visible = false
if enemy_ref.hitBoxTeeth:
enemy_ref.hitBoxTeeth.active = false
func Update(_delta: float):
if enemy_ref.closestPlayer:
if enemy_ref.distanceClosestPlayer > maxFollowDistance:
Transitioned.emit(self, "Wander")
enemy_ref.can_move = enemy_ref.distanceClosestPlayer > 2
enemy_ref.pathfind(enemy_ref.closestPlayerGridPosition)