Enemy:Slime - Orhu/Summer2023Project GitHub Wiki

Overview

The slime is a basic enemy that comes in several sizes. With the exception of the small slime, a slime will split into two smaller slimes when killed. When facing several larger slimes at once, this can easily become overwhelming if you attack recklessly.

Behaviors

Movement

Slimes must see the player in order to detect them. Slimes cannot see through some obstacles. When idle, slimes will randomly wander around the room at a quarter of their normal movement speed. When able to see the player, slimes navigate around obstacles and move towards the player's position. Large slimes can move through obstacles [tentatively]. Upon losing sight of the player, slimes will move to the last position the player was spotted at, then become idle if they cannot see the player from that position.

Attacks

On Touch

If the slime touches the player (via walking into them/being walked into), deal damage. While the slime is in contact with the player, it will not move.

Special

Upon death, slimes will split into two slimes one size smaller than it. Sizes are ordered as follows (Large -> Medium -> Small). When splitting, slimes do not drop pickups. If a slime is the smallest size (small), they die as usual and can drop pickups.

Graphical representation of AI behavior

[Insert decision tree diagram here]

Sprite Gallery

[Insert sprites and animations here]