xxxxxxxxxx
20
let gameMode = 0;
function setup() {
createCanvas(400, 400);
textAlign(CENTER);
}
function draw() {
background(255);
if (gameMode==0){
text("Opening Game Screen\nPress the mouse to start",width/2, height/2);
} else if (gameMode==1){
text("2nd Game Screen\nPress the mouse to start over",width/2, height/2);
}
}
function mousePressed(){
//just flipping between modes 0 and 1 in this example
gameMode = 1-gameMode;
}