Finite state machine

A finite state machine is a a computational model that defines different states an AI can be in. My finite state machine uses conditional if statements to alternate between stationary, (wander and seek) and pursue.
In the second state wander and seek; the AI wanders while the player is in the top half of the screen, and seeks when the player enters the bottom half.