Pre-Order the Game!

Desura Digital Distribution

Sunday, August 1, 2010

Refactoring time again!

When I started work on planetary screen, I realized that I'm doing some things wrong. Each screen have its own list of sprites that it stores. And for each button I basically re-invent the wheel for every screen. So each screen have its own sprite of the same sprite (for example, button in galaxy screen is also duplicated in construction screen, taking up more memory than necessary), and I have to re-program the button functionality for each screen.

This is making the progress slower than it should be. So what I'm doing is to create a GraphicManager class that handles sprites, and all other parts of the game will call this GraphicManager to draw a specific sprite. GraphicManager will also handle animations and return whether or not a mouse click is within a sprite's area. Maybe even handle slider bars and some other basic user interface stuff.

What this will do? This will make creating new screens a snap, since I won't have to reprogram each button's interface. So bear with me until this is done. I think when this class is done, I will add twinkling stars, rotating planets in planet list on galaxy screen, and some other nifty superficial visual effects :)

No comments:

Post a Comment