So, in my game, I like to put all kinds of little sliders and faders to make the UI sexy as possible. One problem I’ve come to though is the massive amount of variables at the top of classes used to control these. I mean, look at this:
int currentMode = 0;
boolean battleStart = true;
int select = -1;
boolean subMenuOn = false;
int textScroller = 0;
int textScroller2 = 0;
int textCapicitor = 0;
int battleBoxScroller = 0;
int commandScroller = -500;
int mugshotScroller = 100;
int mugshotScroller2 = 140;
It’s not really massive, but generally it get’s a LOT longer.
Is there some way to make temporary variables in looped methods without them being reinitialized at the next step? Just curious. I’d like to know for future reference.