xxxxxxxxxx
36
var inp;
var tela = 1;
// Open your console to see the output
function setup() {
createCanvas(400, 400);
background('grey');
inp = createInput('');
inp.position(20, 220);
inp.size(100);
inp.input(verificaResposta);
inp.hide();
}
function verificaResposta() {
let r = parseInt(this.value());
console.log('you are typing: ', r);
if ( r == 4){
tela = 3;
}
}
function draw() {
if ( tela == 2) {
background(220);
inp.show();
}
if(tela == 3){
background(0);
}
if(tela == 1){
inp.show()
background(0,0,255);
}
}