← All projects

Tower defense · Educational

Animal Defense

Educational tower defense game about the food chain

  • RoleGame Designer · Level Designer · Lead Programmer
  • EngineUnity
  • PlatformPC (800×600)

Highlights

  • Teaches the food chain through combat rules: each level of the chain is strong against the one it feeds on
  • Humans can attack anything, to show they sit at the top of the chain, and decomposers boost the gold earned from anything that dies in their area

Leadership

  • Lead programmer, game designer and level designer on a project planned and built in under six months

Overview

A course project tied to the Games and Society class. Planned and built in under six months, the game teaches how the food chain works. I was the lead programmer, game designer and level designer. It was designed for 800×600 screens.

Rules

Every unit deals full damage to what it eats in the food chain, and half damage to everything else:

  • Primary consumers eat producers
  • Secondary consumers eat primary consumers
  • Tertiary consumers eat secondary consumers
  • Producers don’t attack; they slow enemies down
  • Humans sit at the top: they can attack anything, dealing half damage to tertiary consumers and a quarter to everything else
  • Decomposers break down the bodies: anything that dies inside their area earns more gold
Technical deep dive

Waypoint system

The game’s waypoint system still works, and its concept is what I reach for when building a new one. I prefer to rewrite small systems like this instead of reusing them, so I can compare solutions and see how much I’ve changed, both as a programmer and in how I think.

void Update()
{
    if (currentWaypoint < waypoint.Length)
    {
        Vector3 target = waypoint[currentWaypoint].position;
        Vector3 moveDirection = target - transform.position;
        Vector3 velocity = rigidbody.velocity;

        if (moveDirection.magnitude < 1)
            currentWaypoint++;
        else
            velocity = moveDirection.normalized * speed;

        rigidbody.velocity = velocity;
    }
    else
    {
        GameManager.instance.LoseALife();
        Destroy(gameObject);
    }
}

Images

mainmenu emptylevel cowattackarea fulllevel

Like this project? Get in touch or connect on LinkedIn.