Turtle - TypeDefinition/NautiBuoy GitHub Wiki
Turtle enemy:
- Moves in one direction and when it collides onto a wall moves the opposite direction
- When player is on the same x or y axis as it, it will 'charge up', face the player, hide in its shell and start spinning in the direction of the player.
- It cannot change direction once it is spinning, when it collides into a wall, it moves in the opposite direction.
- When it is in its shell, it its invincible to player's default bullets.
Turtle states:
- Idle state
- Charge up state
- Attack state
- Rest state
- Idle -> (player on same x or y axis) -> charge up -> (after a few frames) -> attack and start spinning -> (after a few frames) -> Rest -> (after a few frames) -> Idle
Idle state
- Moves in one direction and when it collides onto a wall moves the opposite direction.
- During idle state, it will check whether player is on the same x or y axis to trigger the change to charge up state and subsequently the attack state.
Charge up state
- Will face the player and move a little bit towards player.
- Has a small two-frame animation of it hiding into its shell when it's getting closer to attack state.
- After a few frames change to attack state
Attack state
- Will hide in its shell and spin around.
- Moves in one direction (the direction it initially sensed where the player was) and when it collides onto a wall moves the opposite direction.
- The turtle is invulnerable in this state.
- After a while, change to rest state.
Rest state
- Similar to idle mode except it does not check the conditions for charge up state and attack state.
- After a few frames return back to idle state.