Escolar Documentos
Profissional Documentos
Cultura Documentos
function preload() {
// Carregando as imagens do prof
costas1 = loadImage("costas1.jpg");
costas2 = loadImage("costas2.jpg");
olhando = loadImage("olhando.jpg");
gameover = loadImage("gameover.jpg");
function setup() {
createCanvas(1024, 576);
}
function troca() {
if (situacao === "olhando") {
situacao = "não olhando";
giz.play();
} else {
situacao = "olhando";
giz.pause();
}
proximaAlteracao = millis() + random(2500, 7000);
}
function draw() {
if (millis() > proximaAlteracao) {
troca();
}
if (situacao === "olhando") {
image(olhando, 0, 0);
} else {
let tempo = millis() % 1000;
if (tempo > 500) {
image(costas2, 0, 0);
} else {
image(costas1, 0, 0);
}
}
if(situacao == "olhando"){
image(gameover, 0, 0);
}
// Estudante 1
let tempo = millis() % 1200;
if (tempo > 400) {
image(farra1, 50, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
} else {
image(farra2, 50, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
}
// Estudante 2
tempo = millis() % 800;
if (tempo > 400) {
image(farra1, 150, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
} else {
image(farra2, 150, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
}
// Estudante 3
tempo = millis() % 900;
if (tempo > 450) {
image(farra1, 250, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
} else {
image(farra2, 250, CADEIRAS_Y, 100, 160, 180, 100, 450, 720);
}
} else {
grito.pause();
estaBaguncando = false;