Pre-Order the Game!

Desura Digital Distribution

Tuesday, August 3, 2010

Ugly code

I created the graphic manager class that will handle sprites and animation. However, when I went through my code and making them use the new class, I realized that the way I did things weren't quite correct.

How it works currently is that it loads the sprite, then uses that sprite's size to handle input and stuff. If I add a button that's 1,000 pixels in height, it will cause the game to draw the whole thing, overlapping everything.

So my plan is to call the drawing function, and tell it the size I want it to draw in (for example 200x40), and it will scale the sprite if necessary to fit in that size. That way, I can separate the input handling from the sprite size.

After that's done, I plan on revamping the galaxy drawing code. I plan to increase the resolution of fleet icon and star sprites, and implement smooth scrolling/zooming. Right now, it jumps one star's size in a direction when scrolling. I also want to fix zooming so it's more accurate in zooming in. When the end of turn prompts "You have explored" or "Select a planet to colonize", I also want them to focus on the star system in question.

No comments:

Post a Comment