If anyone is interested I have modified the platformer starter kit so that it can handle ramps by using SAT:
http://www.mediafire.com/file/9ekhfpf0gt7zehg/PlatformerWithRamps.zip
XNA Tower Defense
Sunday, 12 August 2012
Friday, 11 May 2012
Friday, 4 May 2012
2D Collision Series : SAT Part 1
In this series, I will be giving a very brief insight into the world of 2D collision detection and response. Normally during collision detection there are two phases, Broad phase and Narrow phase.
This series will focus on the Narrow phase.
This series will focus on the Narrow phase.
Saturday, 24 March 2012
Wednesday, 7 March 2012
WANTED : More Tutorials?
Hi guys,
It has been a while since I wrote any tutorials, mainly due to lack of time, but partly due to lack of inspiration... hopefully you can help me out here!
What tutorials would you like to see written? (just to get it clear now, I am NOT writing a series on how to make an FPS, an RTS, an RPG etc... a whole book would most likely be too small for this... ;) )
It has been a while since I wrote any tutorials, mainly due to lack of time, but partly due to lack of inspiration... hopefully you can help me out here!
What tutorials would you like to see written? (just to get it clear now, I am NOT writing a series on how to make an FPS, an RTS, an RPG etc... a whole book would most likely be too small for this... ;) )
Thursday, 2 February 2012
Bug Fix : Tutorial 4 - Waypoints
As has been pointed out in the comments, in the fourth tutorial we added some code to check if the enemy has gotten close enough to the way point to move onto the next. This works well if the enemy is moving with a speed <= 1, however not so great if it moves with a speed of 2 for example.
To fix this we simply change :
to :
Thanks for pointing this out Ryan! This was what I had intended to write but for some reason left the speed hard coded...
To fix this we simply change :
if (DistanceToDestination < 1.0f)
{
position = waypoints.Peek();
waypoints.Dequeue();
}
to :
if (DistanceToDestination < speed)
{
position = waypoints.Peek();
waypoints.Dequeue();
}
Thanks for pointing this out Ryan! This was what I had intended to write but for some reason left the speed hard coded...
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!
So here it is, Merry Christmas!
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!
So here it is, Merry Christmas!
Subscribe to:
Posts (Atom)