-
Notifications
You must be signed in to change notification settings - Fork 4
Enemies
Enemies have 2 main components: behaviours (the enemy AI) and animations
Behaviours tell the enemy what to do at a given time:
-
Patrolselects a random spot at a given distance from the enemy and uses A* pathfinding to move towards it. A new spot is chosen every X seconds. -
SmartChasefinds the player and uses A* pathfinding to move towards it. There was aChasebehaviour without A* pathfinding but was removed. -
PatrolAndActivatestarts as the patrol behaviour but changes to the "Activated" behaviour when the player is seen. -
ChaseAndShootuses aSmartChaseto move towards the player. When the enemy is in shooting range and it has a clear shot at the player it stops moving and begins shooting.
Each enemy has Health, Movement and Animator components.
Patrol until the player is seen, then start chasing. It has damage on collision.
It has 3 animation states: normal, chasing (activated when player is seen), and dead.
! Bat enemies can fly over objects (tables, chests, etc) so they have a special a* graph

Patrol until the player is seen, then start chasing and shooting when in range. It has damage on collision and shooting scripts.
It has 4 animation states: normal, moving (activated by velocity), shooting, and dead.
