Zombie Killer is a first-person shooting game where the player is at the center of a city, surrounded by zombies. The goal is to kill a specific number of zombies to win while surviving and avoiding zombie bites.
Created In: 2022
Collaboration: Made it Myself – Solo
Link to Play the Game:
m4tin – itch.io
Game Engine: Unity- C#
Class Interaction and Design Patterns:
In this game, I used C# delegates and followed Observer design pattern to manage class communications. like communication between the game manager and player health and zombie health.
Also, I used Unity coroutines to make the code easier to read, handle, and maintain. Like the code example below in the Shooting and Bullet tap.
Game States:
Game states algorithm in this game, originally developed for my previous game, Scarecrow: Don’t Look Away, manages different game states such as Play, Pause, Win, and Lose. It primarily uses Enum
and a switch
statement for handling state transitions.
In this game, I optimized the algorithm further since it operates within the Update
function and runs every frame. I introduced a “Done” state, ensuring that when the player’s state changes, it executes a series of functions and then transitions to the “Done” state. This allows shared functionality across states to run only once and checking a single statement each frame, improving efficiency and reducing unnecessary operations.
Settings of the Game:
In this game, I aimed to give players full control by providing two settings sections:
This setup ensures flexibility and allows players to tailor the game experience to their preferences at any time.
Game Difficulty:
In the game, there are four difficulty levels: Easy, Normal, Hard, and Impossible. Each difficulty mainly affects how the zombies behave.
As the game gets harder:
These changes make the game more intense and challenging with every difficulty level.
Zombies:
Each zombie in the game has health, walking speed, and biting speed properties.
This combination of Unity tools and custom logic creates zombies that are both dynamic and challenging, adding depth to the gameplay.
Player Gun:
Instead of a traditional bullet gun, the game features a heat-based gun mechanism to match its scary vibe. This system prevents the player from shooting rapidly when surrounded by zombies, adding tension to the gameplay.
The heat-based gun system enhances the game’s tension and aligns with its overall atmospheric design.
Game Design and Map:
When creating this game, I prioritized programming over 3D modeling since I didn’t have much experience with modeling at the time. The game design uses simple shapes, such as cubes of varying sizes for buildings and capsules for zombies, to keep the visuals straightforward and focus on functionality.
The city generator uses Perlin noise to place buildings with different sizes and colors each time randomly around the city.
In order to surround the player with zombies, I used angle to vector mathematic technique to create areas around the player to spawn zombies.
The zombie spawner areas will detect the intersections and empty areas on the map and spawns the zombies exactly at the street intersections, avoiding spawning any zombie in/on the buildings when the map is procedurally generated.
To fully take advantage of this technique I increased and decreased the zombie spawner areas based on the game difficulty level