xxxxxxxxxx
37
function setup() {
createCanvas(800, 400);
frameRate(5);
}
function draw() {
drawInstructions();
}
function drawInstructions() {
background(0);
textAlign(CENTER, CENTER);
fill(255);
textSize(24);
text("Instructions", width / 2, 100);
textSize(18);
text(
"When the game begins, click on the screen of one of the arcade machines \n" +
"to play the selected game.",
width / 2,
150
);
textSize(16);
text("Press the spacebar to go to the arcade room.", width / 2, 300);
}
function keyPressed() {
if (key === ' ') { // Check if the spacebar is pressed
window.location.href = "arcade.html"; // Redirect to arcade.html
}
}