Hello i would like to continously switch between screens with one click of a button using my mouse (Right click) but i dont know how to achieve this? I've managed to switch the screen with the mouse but it stops when it gets to screen 3. I would like to switch all the time everytime i click and not stop on screen 3.
Code:
int screen = 0;
void setup() {
size(200, 100);
}
void draw() {
background(0);
fill(255);
if(screen == 0) {
text("START THE GAME!!!", 20, 50);
}
if(screen == 1) {
text("your on level 1", 20, 50);
}
if(screen == 2) {
text("Ooh man onto level 2", 20, 50);
}
if(screen == 3) {
text("YOU HAVE WON!!! Gratz", 20, 50);
}
}
void mousePressed() {
screen = min(screen + 1, 3);
}