pretty happy with basic AI behavior

This commit is contained in:
derek
2025-04-29 11:02:12 -05:00
parent ccb4781460
commit a287710a7b
10 changed files with 86 additions and 75 deletions

View File

@@ -55,10 +55,4 @@ func Physics_Update(delta : float):
var direction = local_destination.normalized()
if enemy.global_position.distance_to(local_destination) > 1:
enemy.velocity = direction * idle_speed
enemy.spider_look_next.look_at(destination)
var look_target = enemy.spider_look_next.global_rotation.y
enemy.global_rotation.y = lerp(enemy.global_rotation.y,look_target,delta * 3)
if enemy.turret_look.is_colliding() and enemy.turret_look.get_collider() is Player:
Transitioned.emit(self,"attack")
enemy.global_rotation.y = rotate_to_face2D(enemy,destination,delta,turret_speed)