xxxxxxxxxx
285
var tela = 0
var img = []
var font;
function mouseClicked() {
console.log("Clique botão opção");
if(tela==1){
if(mouseX > 30 && mouseX < 60 && mouseY > 250 && mouseY < 280){
tela=6
}
console.log("Clique botão opção");
}
}
function preload() {
img[0] = loadImage('CAPA JOGO.jpg');
img[1] = loadImage('TL instruções.jpg')
img[2] = loadImage('Carta.jpg')
img[3] = loadImage('Lucas.jpg')
img[4] = loadImage('Cartilha.jpg')
img[5] = loadImage('Terra Plana.jpg')
img[6] = loadImage('Eurekaa.jpg')
img[7] = loadImage('Fundo TT.jpg')
font = loadFont('Suave.ttf')
}
function draw() {
// Menu;
if(tela==0){
stroke(0)
createCanvas(600, 640);
image(img[0], -250, 0)
image(img[7], 110, 60)
fill(240)
rect(190, 200, 200, 100);
if(mouseX > 190 && mouseX < 390 && mouseY > 200 && mouseY < 300){
fill(150)
rect(190, 200, 200, 100);
if(mouseIsPressed){tela=1}}
fill(240)
rect(190, 350, 200, 100);
if(mouseX > 190 && mouseX < 390 && mouseY > 350 && mouseY < 450){
fill(150)
rect(190, 350, 200, 100);
if (mouseIsPressed){tela=2}}
fill(240)
rect(190, 500, 200, 100);
if(mouseX > 190 && mouseX < 390 && mouseY > 500 && mouseY < 600){
fill(150)
rect(190, 500, 200, 100)
if (mouseIsPressed){tela=3}}
noStroke()
textAlign(CENTER)
textFont(font)
textSize(50)
fill(0)
text("Iniciar", 285, 260)
text("Instruções", 285, 410)
text("Créditos", 285, 560)
textSize(58)
fill(240)
text("Quiz Histórico", 285, 130) }
// Instruções
if(tela==2){
createCanvas(637, 474)
image(img[1], -20 , 0)
textAlign(CENTER)
textSize(29)
fill(0)
text("O jogo consiste em perguntas e respostas, onde colocára em prova \n os seus conhecimentos relacionados a história da humanidade. O jogo \n contém um total de 50 questões. Caso ocorra de você errar alguma \n pergunta, o jogo dará game over e você terá de começar tudo de novo. \n Sendo assim o jogo também irá trabalhar sua memória, bom jogo e \n divirta-se, enquanto aprende. Para responder as perguntas é só \n clicar no quadradinho correspondente a resposta certa.", 300, 145)
stroke(0)
fill(240)
rect(30, 380, 100, 65)
if(mouseX > 30 && mouseX < 130 && mouseY > 380 && mouseY < 445){
fill(150)
rect(30, 380, 100, 65)
if (mouseIsPressed){tela=0}}
noStroke(0)
textSize(28)
fill(0)
text("Voltar", 81, 420)}
//Créditos
if(tela==3){
createCanvas(600, 640)
image(img[2], -500, -100)
imageMode(CORNER)
image(img[3], 10, 10, 230, 300)
stroke(0)
fill(240)
rect(5, 540, 100, 65)
if(mouseX > 5 && mouseX < 105 && mouseY > 540 && mouseY < 605){
fill(150)
rect(5, 540, 100, 65)
if(mouseIsPressed){tela=0}}
noStroke()
textAlign(LEFT)
textSize(28)
fill(0)
text("Lucas Marques \nContato: lucas.marques.111@ufrn.edu.br", 250, 125)
textAlign(CENTER)
textSize(28)
text("Voltar", 55, 583)
}
//pergunta 1
if(tela==1){
createCanvas(600, 640)
imageMode(CORNER)
image(img[4], 0, 0, 580, 640)
stroke(0)
fill(240)
rect(30, 250, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 250 && mouseY < 280){
fill("#61380B")
rect(30, 250, 30, 30);}
fill(240)
rect(30, 300, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 300 && mouseY < 330){
fill("#61380B")
rect(30, 300, 30, 30);
if(mouseIsPressed){tela=4}}
fill(240)
rect(30, 350, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 350 && mouseY < 380){
fill("#61380B")
rect(30, 350, 30, 30);
if(mouseIsPressed){tela=4}}
fill(240)
rect(30, 400, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 400 && mouseY < 430){
fill("#61380B")
rect(30, 400, 30, 30);
if(mouseIsPressed){tela=4}}
noStroke()
textAlign(CENTER)
textSize(40)
fill(0)
text("Quem é a pessoa mas linda do mundo?", 300, 150)
textAlign(LEFT)
text("O criador deste jogo.", 70, 275)
text("Você.", 70, 325)
text("Todas as pessoas são bonitas.", 70, 375)
text("Todas as pessoas são feias.", 70, 425)
}
//Game Over
if(tela==4){
createCanvas(600, 640)
imageMode(CORNER)
image(img[5], 0, 0, 600, 640)
stroke(0)
fill(240)
rect(10, 540, 100, 65)
if(mouseX > 10 && mouseX < 110 && mouseY > 540 && mouseY < 605){
fill(150)
rect(10, 540, 100, 65)
if(mouseIsPressed){tela=0}}
noStroke()
textAlign(CENTER)
textSize(28)
fill(0)
text("Voltar", 58, 580)
fill(240)
textSize(50)
text("GAME OVER!", 290, 75)
}
//Win
if(tela==5){
fill(240)
createCanvas(600, 640)
image(img[6], 0, 0)
textAlign(CENTER)
textSize(50)
fill(0)
text("Fim...", 400, 240)
textAlign(LEFT)
textSize(28)
text("A história é testemunha do passado, luz da verdade, vida da \nmemória, mestra da vida, anunciadora dos tempos antigos - Cícero", 45, 500)
fill("#FFFFFF")
noStroke()
rect(5, 550, 100, 65)
if(mouseX > 5 && mouseX < 105 && mouseY > 540 && mouseY < 605){
stroke(0)
fill("#FFFFFF")
rect(5, 550, 100, 65)
if(mouseIsPressed){tela=0}}
noStroke()
fill(0)
textAlign(CENTER)
textSize(30)
text("Voltar", 55, 590)
}
//Pergunta 2
if(tela==6){
createCanvas(600, 640)
imageMode(CORNER)
image(img[4], 0, 0, 580, 640)
stroke(0)
fill(240)
rect(30, 250, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 250 && mouseY < 280){
fill("#61380B")
rect(30, 250, 30, 30);
if(mouseIsPressed){tela=5}}
fill(240)
rect(30, 300, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 300 && mouseY < 330){
fill("#61380B")
rect(30, 300, 30, 30);
if(mouseIsPressed){tela=4}}
fill(240)
rect(30, 350, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 350 && mouseY < 380){
fill("#61380B")
rect(30, 350, 30, 30);
if(mouseIsPressed){tela=4}}
fill(240)
rect(30, 400, 30, 30);
if(mouseX > 30 && mouseX < 60 && mouseY > 400 && mouseY < 430){
fill("#61380B")
rect(30, 400, 30, 30);
if(mouseIsPressed){tela=4}}
noStroke()
textAlign(CENTER)
textSize(40)
fill(0)
text("Quem é a pessoa mas linda do mundo?", 300, 150)
textAlign(LEFT)
text("O criador deste jogo.", 70, 275)
text("Você, gata.", 70, 325)
text("Todas as pessoas são bonitas.", 70, 375)
text("Todas as pessoas são feias.", 70, 425)
}
}