I’m having trouble with my menu screen for a game I’m trying to code. When I click the mouse, it isn’t taking me to the next screen (i.e when I click levels it doesn’t show the levels screen.) Can anyone help me? Thank you! (Here’s what I have for the code so far)
int select=1;//start game-1,levels-2,instructions-3
int gameScreen=1;//game-1,levels-2,instructions-3,main menu-4
void setup(){
fullScreen();
}
void draw(){
textSize(80);
println(mouseX,mouseY);
click();
titles();
}
void titles(){
background(0);
text("START GAME",50,250);
text("LEVELS",50,550);
text("HOW TO PLAY",50,850);
}
void gamePlay(){//MOVE TO NEW TAB WHEN STARTING FOR ALL VOIDS
background(0);
text("Start game here", 50,550);
}
void levels(){
background(0);
textSize(80);
text("LEVEL 1",850,150);
text("LEVEL 2",850,350);
text("LEVEL 3",850,550);
text("LEVEL 4",850,750);
text("LEVEL 5",850,950);
}
void tutorial(){
text("We will write the tutorial here",50,550);
}
void click(){
if (mouseX>34 && mouseX<563 && mouseY>174 && mouseY<255 && mousePressed){
gameScreen=1;//game
}
if (mouseX>34 && mouseX<328 && mouseY>483 && mouseY<551 && mousePressed){
gameScreen=2;//levels
}
if (mouseX>34 && mouseX<333 && mouseY>770 && mouseY<858 && mousePressed){
gameScreen=3;//instructions
}
}