Monday, 28 June 2010

More unto the breach dear friends...

Well now that I have been working on the engine I can now see how better to write certain areas to make it easier to manage and locate errors, one of these is localisation of classes:

Before we had a class that handled everything and was assigned to the Tombstone main class this meant everything had 'Tombstone.' on the beginning of it. Ordinarily this might have been a nice idea to unify the engine but is notoriously unhelpful and time consuming you had things like Tombstone.EntityColour( Quad, 255, 0, 0 ); to colour Quad to red for instance. This is now localised to something like this:
TEntity Quad; //sets up the variable
Quad.CreateQuad(); //create the Quad entity (this could be anything like cubes, loading etc)
Quad.EntityColour( 255, 0, 0 ); //colour it red.

As you can see its much more 'pretty' AND the upside is I dont run through the entire class to locate the ID of Quad to change it to 'red' I now just look at Quad's TEntity and then colour that red.

I am also changing textures, sprites, etc to the new system so I just work on the 'things that need it' :). Exciting times ahead for Graveyard Dogs and Tombstone :)

More soon...

1 comment:

  1. Wow! I just discovered this! I'm pretty sure I'll be back. Kinda on family time today but will return. Hit me up at @InfiniteUnity3D if you do unity work.

    ReplyDelete

blogdigger