The zombie character needs intelligence, that is, the ability to take appropriate actions and responses in front of the player. Specifically, the zombie should balance actions between idling, chasing, and attacking at appropriate times; to achieve this, we'll need Artificial Intelligence. This essentially involves coding functionality to help the computer make good decisions under specific conditions where multiple outcomes are possible. AI (for video games) is not, however, about coding an inward consciousness or phenomenology, and it's not about replicating the workings of the human mind. Rather, it's about deciding how NPCs behave, and creating the illusion or appearance of intelligence to enhance the experience and realism for the player. For the zombie, we'll code AI using Finite State Machines.
The FSM is essentially...