Sunday 25 December 2011

Merry Christmas!

As a very big thank you to all of those that have read this blog and helped improve it by pointing out my mistakes, I have decided to release an older version of my personal tower defence!

It includes two different types of pathfinding, one that helps the enemies get to the end of the level, and one that detects if the player is “blocking”.

The algorithm used to get the enemies to the end of the level is a variant of the breadth first algorithm. The algorithm generates a direction for each tile which points to a neighbouring tile. The neighbouring tile also contains a direction to a neighbouring tile; eventually if you just keep following the directions you follow a path to the goal!

It also includes a basic level editor, however you will only be able to save levels using the shortcut Ctrl + S, though the code to load the levels is included!

Just be warned the game isn’t at all balanced! Winking smile

So here it is, Merry Christmas!

Saturday 10 December 2011

A* Pathfinding Tutorial : Part 3

Welcome to the final part of the A* pathfinding tutorial! In this tutorial we will be implementing the algorithm I described in part 2 in code!

At the start of this tutorial we will be adding some useful properties and methods to the SearchNode and Pathfinder classes that will make writing the FindPath method more simple.

Then to finish off I will post the full code for FindPath method indicating which piece of code relates to which step of the algorithm posted in the last tutorial!

Edited on the 10/12/2011 at 8:00pm