Tuesday, February 12, 2008

Time to unwind.

I took a few days off last week from focusing on the code. Mainly the weekend as I spent time with my son and nephew. After having that time away and then coming back to work on the game again, I began sifting through the code for the demo and thought to myself that it's now time to start refactoring code.

The demo , in it's current state, is an ugly mesh of global functions, the physics code for the block management and bullets are stuck inside places that don't really make sense and use math functionality that can easily be stuck into a component class for reuse, and it's all large enough where it's hard to manage and can take anywhere from 30 secs to 2 minutes for me to find a certain section of code at times. These are all bad signs.

I was planning on waiting to refactor until I was finished with the proto-type, but the code is getting in the way of productivity now and the addition of a vector class and a generic physics class to the engine in general will be a definite benefit. I'm also going to take this time to go a head and begin implementing the support for game pad functionality into the engine.

Doing all this stuff also has a second function. It's going to allow me to do some more experimenting with the wide area collision management system as well as allow some time to do additional research as I've yet to finish that part of the game. Also the addition of the physics class for the engine will allow me to handle multiple types of physics calculations for a single function that I can switch between in certain instances which will add for some interesting play mechanics.

This means that a public demo has the possibility of being delayed a little, but hopefully not, as once these items are done it should actually speed up things nicely, it'll also make for a more complete demo and hopefully save time in the overall development of the game once we start production of that.

No comments: