Tuesday, April 28, 2009

More code refactoring

The main script file is becoming a bit disorganized. I *did* refactor the code when I had planned to previously, but I think the time has come to break things out into separate classes. The main game class, a new class for the player, another class for the current solar system. This way, if a new system is dramatically different, we can create a class for it, and bring it up when you enter. Carrying this further, I may make a generic system class, and inherit most of the standard operations from it, but still be able to override / extend for special cases.

In any event... Later tonight there will be an update to the latest code. Orbiting is about half implemented. You can enter / exit orbit using the o key, but it is always a latitudinal only orbit, regardless of what your latitude is (even if you are above the 0 degree point). Also, you ext with no speed reference.

Plans will be to make the orbit reflect your entering angle, and add a 'Z' element to the orbit path. I will prolly have to change to calculating the path rather than cheesing out and using an orbit node that is constantly rotating and just attaching to it.

Anyway. It will be a couple days (prolly over the weekend) to get the classes broke out and restructure everything so that it works the same. The result, though, will be significant. This will step it up from being a demo to something usable.

Thanks for playing along!

--Joe

No comments:

Post a Comment