Turret Defence Game – Playable Prototype #1

Hey folks. Made some big progress with the Tower Defence game and decided to share, as it has now reached the stage it can be considered a ‘game’, in the broadest sense of the thing.

First up, here’s a link to the playable prototype:


  • Mouse to edge of the screen to pan around the level.
  • Mouse wheel zooms in and out.
  • Middle mouse click and hold, drag around to pan.
  • Left click on tower icons to select which to place, left click on a white square to place.
  • Left click on a Red Panda unit (there are two) to select, right click to select where it moves to.

Here’s a breakdown of the game in a series of cutting-edge, AAA-quality screen shots.


Here’s a still from the prototype running – click to zoom in. Note the tower BUTTONS bottom left, PLAYER CASH and BASE HEALTH info along the bottom.


Above are the three available towers. LEFT is a MACHINE GUN tower, MIDDLE is a CANNON and RIGHT is a FLAME THROWER.


Here are our two RED PANDA units from my original rough prototype.


Terrifying! Enemy blocks here, intent on making their way to your blue base, where you keep all your cash and muffins.


The NAV MESH for path-finding, highlighted in YELLOW. This was created with RAIN AI, a free AI plugin, found on the Asset store.


Here’s another screen shot of the game working.

To get to this stage I’ve implemented a number of SYSTEMS:

  • PATHFINDING: The dreaded enemy CUBES and the heroic RED PANDA units both use RAIN AI to find their way across the NAV MESH laid out by RAIN AI. For the cubes this is simply using a start point – which also spawns them – and an end point, with regular scripts attached for everything else.
  • MAP: The level is a basic ‘maze’ for the CUBES to make their way through, from their SPAWN POINTS to the end at the blue BASE.  There are PLACEMENT SQUARES for the towers, which I had to ensure would only allow the towers be placed in specific areas, and SEPARATE NAV MESHes for the CUBES and RED PANDAS.
  • UNITS: For the RED PANDAs it’s far more complicated, as they need to have a POINT AND CLICK interface, as well as being SELECTABLE (with highlights during). You can find out more about this in my previous posts. They work as mobile towers, with additional gameplay potential in further prototypes.
  • TOWERS: The towers DETECT the CUBES with use of the RAIN AI ‘senses’ and ‘entity’ system. The have a ‘visual’ sensor which keeps an eye out within a radius for an ‘aspect’ entity attached to enemies. When it sees one it will turn to it. Each tower has a different behaviour. The MACHINE GUN tower uses a RAYCAST to SEND MESSAGES to the cubes inflicting damage and INSTANTIATING particles for impacts. The FLAME THROWER works in much the same way, but with a flame particle enabling on the CUBE, with a timer for how long it stays on and inflicts damage. The CANNON uses a RAYCAST to discover the distance to the CUBE and fires a ball, the force getting higher the further the enemy is. It then creates a radius which sends damage to every enemy in range.
  • UI: The buttons at the bottom INSTANTIATE the ‘ghost’ of a tower – a transparent version – to aid in placing it. This ‘sticks’ to both the plane and the mouse. When the player clicks on a placement square a final tower is instantiated. The UI also has a variable manager keeping track of CASH and BASE HEALTH, and updating to the screen.

This whole process has taken perhaps 2-3 weeks off and on, mostly with the new Towers and UI work. Some THINGS TO NOTE:

  • GRAPHICS: Totally 100% placeholder – the minimum effort required to make it functional. Seemed more important to get the game working than pretty at this stage.
  • AUDIO: There is basically none. There needs to be more than none.
  • BALANCE: There is basically none. The cubes remain the same health/speed throughout, rather than get ‘harder’ as it goes, as is normal.
  • GLITCHES: For instance: Cash is a bit quirky, allowing you to go into negative funds for instance.
  • FAIL STATE: You can lose if the cubes reach your base. There is no win-state currently.

GOING FORWARD with the next version:

  • UPGRADES: The towers will have 3 ‘levels’, which cost cash. You will be able to select them to upgrade or sell them. The units may or may not upgrade in-level – it may be you customise them between level.
  • IMPROVED SYSTEMS: Now they ‘work’ mostly, it’s time to make them ‘good’. This also goes for such things as the UI.
  • ENEMIES: Actual enemy ‘units’, rather than block placeholders. The first of which will take the form of the Red Panda’s mortal enemy… the diabolical Martens! Snow Leopards are also bastards to Red Pandas.
  • LEVEL DESIGN: To be an actual location, rather than flat shapes. Red Pandas live in Arborial, Mountainous regions. So there’s that. Multiple levels would be ideal, each getting more challenging and introducing the game elements.
  • NARRATIVE: A story to tie it all together, following the Red Panda’s and their Coatie and Racoon cousins, as they fight the dread-forces of the evil Great Panda overlord.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s