Tuesday 7 February 2012

Refactor

I've been through the code base and had a bit of a tidy up.

There is now a static class which holds all of the controls for the player, this is really useful as it maps an xbox pad button reference to a key so I don't have to keep remembering which key I assumed would be the start button!

I've also removed all game variables (like start lives, score multipliers. Etc) from the classes that use them as there was too much duplication and find and replace. Now there is a singleton options class that can be used to get option settings. Why isn't it a static class? Because I want to be able to set the values in the options if need be and static would fix them.

Another change is the camera and lights are now part of a scene object that is passed into the level.

Player objects are also now created at game state and passed into the level. This means I don't have to track player variables outside the level for when the next level is created. It makes sense as the state of a player exists across multiple levels.

It needs some nicer graphics too. I'll try my best!

Oh and an xbox trial mode!

Adding some incentives

So now you can collect fuel power ups to top your fuel up and also if you score over a certain number then you get an extra life!