The evil bats in Light the Lamps have three states: moving, attacking, and frozen. The bats start the game moving randomly around the screen – their “moving” state is their default state. They transition into their attack phase – which consists of shooting “globs” of red at the lamps on either side of the screen – when the player crosses over one of three invisible “trigger” lines that I’ve placed equidistant from one another. They enter their frozen phase when the player manages to grab one of the floating blue circular power ups that appear at random points throughout the game. The patterns of these bats are very reliant on player choice, which will hopefully make the game more interesting and playable.
The enemy showcases three distinct states – dodging, advancing, and recharging. When it is not doing one of these three, its “idle” state is steadily moving back and forth and firing shots at a rhythmic pace.
The enemy’s total health in conjunction with its quantitative distance from the player act to determine the frequency
of when its states are called. For example, if the enemy’s health is low, it will attempt to recharge and strafe more frequently, but its distance from the player has the final say in whether the state is even executable.
With both variables interacting with one another, the state probabilities are in constant flux, simulating spontaneous behavior. I’m still unsure of what my exact formula will be to determine frequency, but I’m pointing in the direction of either a modulo timer with a changing limit or a randomizer with a changing scale (or a combination of the two).
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.