← Work
Case study · 2021 · Game Developer

Zombie Dinosaurs 3D

Zombie Dinosaurs 3D was my high school graduation project. I did the programming, game design, 3D modeling and animation, with a friend helping on some of the programming and another writing the music. In the game you fend off hordes of zombie dinosaurs and try to survive as long as possible.

The project

Zombie Dinosaurs 3D was my high school graduation project, which I made over about six months in 2021. It's a first-person survival game built in Unity with C#. I wanted it to be a complete game, so I ended up working on almost every part of it.

I did the programming, game design, 3D modeling, animation and sound effects. My friend Leo Ekstam helped with some of the programming, and Karl Sandegren made the music. Three of the 3D models and the game's textures came from outside sources, and I made most of the rest.

You survive waves of zombie dinosaurs that get harder over time. Killing enemies gives you points, and you search the map for ammo, food and medkits and switch weapons depending on the situation.

Killing enemies also earns ZD Coins. You spend them in the shop, which you reach from the main menu, to buy and equip weapons for the next run.

Weapons

The game has a pistol, a knife, an SMG, a shotgun, a sniper rifle and grenades, and they behave very differently. I wanted to reuse as much of the weapon code as I could. A BaseWeapon class holds what they share, like damage, range and fire mode, and each weapon adds or ignores what it needs. That way a new weapon didn't mean copying the common logic.

Grenades are separate from the other weapons because they're used differently. You hold the button to prime a grenade and let go to throw it, and pressing another button while holding it cooks it before the throw.

The weapon manager ended up handling too much of each weapon's behaviour. A better version would have the manager only coordinate, and let each item handle its own behaviour through generic methods and callbacks. That would also make it easier to add items that aren't weapons, like food and medkits.

Enemy spawning

The spawning system controls how the difficulty goes up as your score climbs. There are several enemy types, including a fast one, a tanky one, a small one and one that explodes. Each type has spawn weights tied to score thresholds, so the mix of enemies changes as you score more points.

FindValue() finds the weight that currently applies to an enemy type by checking its thresholds from highest to lowest. FindSpawnObj() adds all the current weights together, picks a random number within that total, and subtracts each enemy's weight in turn until the number falls inside one. That enemy is the one that spawns, so each type's chance is proportional to its weight.

Spawning
private float FindValue(SpawnThing spawnThing)
{
    for (int i = spawnThing.values.Length - 1; i >= 0; i--)
    {
        if (ScoreManager.points >= spawnThing.values[i].pointThreshold)
            return spawnThing.values[i].value;
    }

    return 0;
}

public GameObject FindSpawnObj()
{
    float fullValue = 0;

    foreach (SpawnThing spawnThing in spawnThings)
        fullValue += FindValue(spawnThing);

    float randNum = Random.value * fullValue;

    foreach (SpawnThing spawnThing in spawnThings)
    {
        float value = FindValue(spawnThing);

        if (randNum < value)
            return spawnThing.obj;

        randNum -= value;
    }

    return null;
}

After picking an enemy, the system picks a random spawn point and checks its distance to the player. If the point is too close it tries another one, so enemies don't appear right next to you. The enemy cap, the spawn interval and that minimum distance are all set in the inspector, so I could tune the difficulty without touching the code.

What I took away

It was the first time I took a game from an idea all the way to a finished, playable game. I had to handle both the programming and the content, and then make it all work together.

Looking back at the code in 2026, there are parts of the architecture I'd redesign, mostly the weapon and interaction systems. The project still gave me a solid foundation in Unity and C#, and taught me a lot about structuring gameplay systems so they can be extended without rewriting large parts of the game.