Bad Guys: Object Design — Rabid Squirrels


Our squirrels have three different phases of difficulty within the game: basic, acorn, and mega. At first we thought that this might make our behavioral chart intricate and complicated, until we realized that the squirrels have the same underlying pattern despite the increase in difficulty that occurs. These basic states are: seeking the player, attacking the player, and fleeing the player.

These behaviors are each triggered by a transition value, which we will alter as the squirrels enter different states of villainy.


The first transition, from seeking to attacking, is triggered as the squirrel reaches a certain distance to the player. This value will be initialized as being quite close to zero, so the squirrel will have to be nearly on top of the player to attack, and will increase as the game becomes more difficult, so the squirrel can do damage from further away.

The second transition, from attacking to fleeing, is triggered when the squirrel is sprayed with water by the player. This will begin at one squirt, and as the game increases in difficulty the player will need to hit the squirrel multiple times in order to defeat it.

Finally, the transition from fleeing to seeking will be triggered when the squirrel is a certain distance away from the player. This will begin as a high number, so the squirrel will flee nearly to the opposite side of the screen. The distance will shrink as the game increases in difficulty, to add additional challenges for the player.


Author: Amy York