I have a code that isn't working.
I have an integer called fade
public int fade = 255;
and I make fade smaller like so:
if(fade >= 0) {
try {
fade = fade - 1;
Thread.sleep(100)
} catch(Exception e) { }
}
then I'm drawing a black box over the whole screen that uses fade as the alpha exception. The code will not work!
Although if I make fade = 0 then do this
if(fade >= 255) {
try {
fade++;
Thread.sleep(100)
} catch(Exception e) { }
}
and this makes the box fade in ...