Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

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.

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

Wednesday, 29 September 2010

Tutorial 6 : Tower Management

This tutorial will mainly focus on how the player will add in new towers through the addition of a new class called “Player.cs”.

The Player class will hold all the information about a specific player, such as how much money he has, what stage he is on etc. The reason we are putting all this information in it’s own class and not just in “Game1.cs” is that if we do decide to make this game multiplayer, it will make it much easier to store information about each person playing.

Sunday, 26 September 2010

Tutorial 5 : Towers

Now that we have something to shoot at, I think it is about time that we start adding in the “Tower” part of our Tower Defence. We will start off by creating a simple base class for the tower and getting it drawn, then we will move on to making it aim at our enemy. I will be leaving shooting, and placement of towers till next time. So, lets begin!

Tutorial 4 : Waypoints

In this tutorial, I will show you a method on how we can get our newly created enemy’s to follow the path that we have drawn out on our level.
The first big hurdle we face is, how will an enemy where the path is, when should he turn, when does he know when he is at the end of the path? This is where waypoints come in, when we are designing our levels, we can specify a set of points along a path (normally on the corners of paths), then when we load in our levels, we will tell our enemy’s that we want them to move between these points until they reach the end of the path.
image
As shown in the image above, we will specify a start and an end for the enemy, as well as intermediate points.

Saturday, 25 September 2010

Tutorial 3 : The Enemy Class

To start with, we will be creating a new class called "Enemy.cs", this will be a base class for all our enemy's, whether they are bosses or fast units or just plain cannon fodder.

So to start with add a new class called "Enemy.cs", then add the following using statements :

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

From now on these 2 namespaces will need to be added to nearly every class, so I am just going to assume that you will remember to add these.

Sunday, 1 March 2009

Tutorial 2: Sprites

Ok, so I said that next time we would me creating a level editor, I lied. I have decided to leave creating the level editor to the end. This way we won’t have to keep adding to it all the way through. Instead we are going to create a sprite class. This will be our base class for our enemies, towers etc. It’s going to hold the basic data about our sprites e.g. there texture, position and so on.

Saturday, 28 February 2009

Tutorial 1: Levels

Ok, so the first part of our tower defence that we are going to make is a simple terrain class. Please note that most of this code is going to be from Nick Gravelyn’s Tile Engine Series. I’m assuming you know how to create a new project so I’ll skip that bit.

Ok, so to start off with create a new class called “Level.cs”. This is going to be what holds all the information about our level (which textures go where basically).