Friday, February 26, 2010

AStarPathfinder

I've created an extensible and fairly simple implementation of A* pathfinding for the PandaXNA engine.

Video:
http://www.screentoaster.com/watch/stWE5RRUdIR19YQVRfWllcUVJc/simple_a_pathfinding

Here is the class:
http://mage360.pastebin.com/34xSMVby

Here is the implementation in Gnome Mountain:
http://mage360.pastebin.com/2QaAgT9p

Example of usage:

pathFinder = new GnomePathfinder(world);
pathFinder.initialise(worldRect.Width, worldRect.Height);

testPath = pathFinder.generatePath(new Vector2(0, 49), new Vector2(3, 35));

In case anybody is wondering about the basic theory behind A* pathfinding, here is a cool tutorial I found lying around the internet. It's very easy to understand and very informative: http://www.policyalmanac.org/games/aStarTutorial.htm

Saturday, February 20, 2010

BasicCamera2D

Another part of the game engine developed with the Gnome Mountain mini-project. This is a basic 2D camera class that can be easily extended.

Source:
http://mage360.pastebin.com/f3798a7d8

You'll also notice that the engine classes have been moved to a new project and namespace called "PandaXNA". This is now the name of the game engine that will be used by M.A.G.E.

Attribute tag personality

With my Gnome Mountain mini-project (using this to build up all the 2D parts of the game engine) I've decided to develop an attribute tag based personality system. This will be used for the Gnome AI.

The personality class:

An example of the use, checking if a gnome is a miner and finding him a job:
if (gnome.personality.hasAttribute(PersonalityAttribute.Miner))
{
if (findMiningActionForGnome(gnome, world))
return;
}

The system basically works using a Dictionary< Attribute, Skill Level > collection.

Wednesday, February 17, 2010

AnimatedSprite and an amazing video hosting website.

Here is my AnimatedSprite class:
http://mage360.pastebin.com/f2c03daf1

And here is a video showing it off, on an amazing video hosting website that lets you record your screen:
http://www.screentoaster.com/watch/stWE5RRUdIR19ZRFhYWFJdVlZV/sprite_animation_and_movement

Thursday, February 11, 2010

Sprite class v4

Just a small Sprite class update, I've added a flashing effect.

Source:

Game state management

I've created a class to manage the current game state. It's a very simple but flexible way to manage the current state of the game. I can just derive classes from the GameState class for anything from the main menu to the game in progress, and easily switch between states.

Here is a link to the GameState class source:

Monday, February 1, 2010

SpriteList v1

I've created a simple class to handle variable amounts of sprites from a single simple interface. This is called SpriteList.

Link to the SpriteList class:
http://mage360.pastebin.com/f3aaf313

Sprite class v3

The sprite class now has a scaling effect. Testing all effects together I have the sprite fading from 50 alpha to 255 alpha over 2 seconds, at the same time it is rotating counterclockwise by 180 degrees over 2 seconds. While both of those are happening it is also scaling to 3x the original size over 2 seconds.

This is the code being used to test the effects together:
test = new Sprite(Content.Load("Sprites\\Statues"));
test.position = new Vector2(50.0f, 50.0f);
test.setTransparency(50);
test.beginFadeEffect(255.0f, 2000.0f);
test.beginRotationEffect(MathHelper.ToRadians(-180.0f), 2000.0f);
test.beginScalingEffect(3.0f, 2000.0f);



Here is a link to the sprite class:
http://mage360.pastebin.com/f427b2e0b

Sprite class v2

The sprite class now has a rotation effect. Testing them together I have the sprite fading from 50 alpha to 255 alpha over 2 seconds, at the same time it is rotating counterclockwise by 180 degrees over 2 seconds.

This is the code being used to test the 2 effects together:

test = new Sprite(Content.Load("Sprites\\Statues"));
test.position = new Vector2(50.0f, 50.0f);
test.setTransparency(50);
test.beginFadeEffect(255.0f, 2000.0f);
test.beginRotationEffect(MathHelper.ToRadians(-180.0f), 2000.0f);

Here is a link to the sprite class:
http://pastebin.com/f68be73c6

Sprite class v1

Here is a video of my sprite class for doing 2D graphics, demonstrating the fade effect.



The sprite class source:

http://pastebin.com/f6fd08893

Early artwork.

What is M.A.G.E?

MAGE is an Xbox 360 indie game. I'm developing this to see if I can make a game that will pass the XNA Creator's Club review process and get onto the indie marketplace.

The game is about a fight between magicians in an arena setting. It's based on the idea of those mini games we've all played before where you need to somehow push an enemy off of a platform to win.

In this game you need to strategically use magic spells to cause all the enemy magicians to fall off of the main platform.

In this blog I'll be posting development information and maybe tutorials etc. Just things that I learn about XNA as I'm making this, because this is my first attempt at using XNA to build something.