gitdefence / game-off-2012

Build networks, destroy bugs
http://www.justinmcgirr.com/gitdefence/master/game/
5 stars 1 forks source link

Resizeable #91

Closed crazy2be closed 11 years ago

crazy2be commented 11 years ago

This pull request makes the entire game resizeable.

It's very large, as I made some other significant refactorings at the same time, mostly just renaming things to get rid of cruft.

TemporalPos is finally dead, just rect is used now.

crazy2be commented 11 years ago

The other significant thing I did is remove all of the attack attributes and such named with underscores for legacy formatting reasons. formatToDisplay() now no longer does (and no longer needs to) remove underscores.

yeerkkiller1 commented 11 years ago

Nothing in here appears to be mission critical so I am going to hold off on this pull request.

crazy2be commented 11 years ago

Ok, feel free to take a bit to understand everything which was changed here. If you have any questions, feel free to ask.

Nothing here is mission critical, but it does make a lot of things much easier, and paves the way for significant optimizations.

I would encourage you to pull down the code locally and see how easy things are to change for yourself- For example, moving the gameinfobar from the top of the screen to the bottom involves simply moving two lines of code. Moving it to the side requires changing a couple more, as you have to change how gameinfobar lays itself out, but is a million times easier than it used to be.

The main improvement in this pull request is not really the dynamic resizability of the game window, although that is nice, but rather the ability to easily change the layout of the entire game quickly and easily.

crazy2be commented 11 years ago

The gameBoard does not resize anymore, it simply centers itself at a fixed size within the space allotted for it. This allows us to get most of the benefits of having the GUI components resizeable, but without us having to build a system in for all game stats, like range and speed, to scale based on the size of the gameBoard. We can build that in later, but at this point it's quite a bit more work with relatively little benefit.