xxxxxxxxxx
35
let questions = ["quest1", "quest2", "quest3"];
let q1,q2;
let button,button2;
function setup() {
createCanvas(400, 400);
background(220);
button = createButton("start");
button.position(width / 2, height / 2 + 10);
button.mousePressed(scene2);
q1= createP(questions[0])
q1.position(width/2, height/2-20);
}
function draw() {}
function scene2() {
let bgCol = color(254, 0, 255);
background(bgCol);
button2 = createButton('end');
button2.position(width/2, height/2 + 10);
button.hide();
q1.hide();
q2=createP(questions[1]);
q2.position(width/2, height/2-20)
}