itch.io is community of indie game creators and players

Devlogs

Day #11 Cat Finite State Machine

Forbidden Entry
A browser game made in HTML5

Having worked on the base for pathfinding yesterday I worked on the Pet cat scene. First I drew a few animations I'd need for each state like idle, walking, sleeping, etc. Then I started coding the animations into each state, as well as the logic behind the trigger for each state.

At this point in development, the cat starts moving at random target positions, but later it'd go directly to the nearest owner and alert them of your presence.

The cat sleeps by default. When you enter the first area of detection, it opens its eyes, and entering the second will trigger its alert state which consists of it raising its head slightly and moving its tail. Then if you ramain in its area of detection for 5 seconds, it'll stretch and start walking at random, and sitting in place when its velocity is zero.

When I design a level I'll put in place certain target locations that'll trigger certain states and animations like a bed for sleeping, the owner's position as a "walk to" position, etc.

I'll work on the guards and owners next.

Files

  • Day11.zip 4 MB
    Apr 11, 2021
  • Day11Executable.zip 13 MB
    Apr 11, 2021
Download Forbidden Entry
Leave a comment