Enemy:Bat - Orhu/Summer2023Project GitHub Wiki
Overview
The bat is a flying enemy that typically appear in swarms. They try to swarm the player, flying nearby them and periodically swooping in to attack. Bats will attack more frequently the more bats there are in the room, so players should aim to take out swarms quickly.
Behaviors
Movement
Bats will attempt to move towards the player, hovering in place within 1 tile of them. When the player moves, bats will move to correct the distance between them and the player if they move beyond 1 tile of them, however bats that the player moves towards will not try to correct this distance (allowing the player to get within range to kill the bats). Bats can fly over ground-based obstacles and hazards without triggering them (i.e. they will not take damage from spikes when passing over them).
While within attacking range of the player (1 tile), bats will enter their attacking behavior and dive at the player one at a time. Bats will try to position themselves in a circle around the player as so that they are all spaced out equally from one another.
Attacks
Dive
When surrounding the player, bats will attack the player one at a time. Bats share a cooldown for this attack, so only one bat would attack each time the attack is off cooldown. Each bat there is in the room will reduce the cooldown by 1 second to a minimum of 2 seconds.
On Touch
If the bat touches the player (typically during a dive attack), deal damage.
Special
Bats operate as a hive mind and do not attack independently of one another. All bats in a room will swarm the player together and attack one at a time.
Graphical representation of AI behavior
[Insert decision tree diagram here]
Sprite Gallery
[Insert sprites and animations here]