Mutants vs Zombies

Background

Programming

The file structure of this game is organized in groups of related classes. Each group contains scripts related to a specific area of the game.

Each character is composed of a base script (player or zombie) and an attribute script (specific hero or type of zombie). I took this approach instead of using inheritance because it was the simplest way to implement individual behaviors when considering that the characters were relatively simple themselves. The player script defines everything that a player can do regardless of which hero they chose, and the hero scripts then go on to specify more specific abilities. The Zombies are set up the same way. As you can see in the example below, every zombie can move, take damage, get swallowed by a vortex, and make sounds, but the baby zombie script sets its target to the player in the start function and it never changes. This causes the baby zombie to only chase the player, and never attack the base unless it is in it’s way to the player.

Player

Speed Hero

Zombie

Baby Zombie

Design

Scroll to Top