xxxxxxxxxx
157
var imagemEducador;
var imagemProgramadora;
var escolhaFase = 0;
var pontos = 0;
var corDaFonte = '#E11584';
var corDasBordas = '#9E4244'
var deslocamentoBotaoMenu = 90
var xMinBotao = 150
var larguraBotao = 200
var xMaxBotao = xMinBotao + larguraBotao
var alturaBotao = 60
var yMinBotao3 = 160
var yMaxBotao3 = yMinBotao3 + alturaBotao
var yMinBotao1 = yMinBotao3 + deslocamentoBotaoMenu
var yMaxBotao1 = yMinBotao1 + alturaBotao
var yMinBotao2 = yMinBotao3 + 2 * deslocamentoBotaoMenu
var yMaxBotao2 = yMinBotao2 + alturaBotao
var imagemEducador;
var imagemProgramadora;
var fundoMenu;
var fontChango;
var tela = 0;
// tela 1: instruções
// tela 2: creditos
var corDaFonte = 10
function menuBotao(texto, yMin, yMax, opcao) {
if (mouseX > xMinBotao && mouseX < xMaxBotao && mouseY > yMin && mouseY < yMax) {
fill('#fff0f3');
//if (mouseIsPressed) {
//tela = opcao;
//console.log("Clicou no botao")
//}
}
else {
fill('#FEC5E5');
}
stroke(corDasBordas);
rect(xMinBotao, yMin, larguraBotao, alturaBotao, 15);
noStroke();
textSize(26);
fill(corDaFonte);
text(texto, xMinBotao, yMin + 20, larguraBotao);
}
function telaMenu() {
background(220);
textSize(32);
fill(corDaFonte);
textAlign(CENTER);
text("Desvendando Sequências", 100, 50, 300);
textFont('cursive');
menuBotao("Jogar", yMinBotao3, yMaxBotao3, 3);
menuBotao("Instruções", yMinBotao1, yMaxBotao1, 1);
menuBotao("Créditos", yMinBotao2, yMaxBotao2, 2);
}
function telaInstrucoes(){
background(220);
textSize(36);
fill(10);
text("Instruções", 150, 70);
textSize(16);
text("Primeira instrução: use o mouse para selecionar as opções. ", 20, 120, 460)
}
function telaCreditos(){
background(220);
textSize(36);
fill(10);
text("Créditos", 160,70);
textSize(20);
text("RENATO RODRIGUES", 200, 120 );
text("JÚLIA MAFRA", 240, 300 );
textSize(16);
text("Função: Educador", 230, 140 );
text("Função: Programadora", 230, 320 );
textSize(14);
fill(80);
text("Licenciado em Matemática pela Universidade Federal do Rio Grande do Norte, Especialista em Educação ...", 180,165, 300 )
text("Estudante do Bacharelado em Ciências e Tecnologia na UFRN.", 180,345, 300 )
}
function preload(){
}
function telaJogar() {
background(220);
textSize(36);
fill(10);
text("Jogo em ação", 160,70);
}
function mouseClicked(){
if (tela == 0 ) {
if (mouseX > xMinBotao && mouseX < xMaxBotao && mouseY > yMinBotao3 && mouseY < yMaxBotao3) {
console.log("Clicou no botao 3 - Jogar ")
tela = 3
}
if (mouseX > xMinBotao && mouseX < xMaxBotao && mouseY > yMinBotao1 && mouseY < yMaxBotao1) {
console.log("Clicou no botao 1 - Instruções ")
tela = 1
}
if (mouseX > xMinBotao && mouseX < xMaxBotao && mouseY > yMinBotao2 && mouseY < yMaxBotao2) {
console.log("Clicou no botao 2 - Créditos ")
tela = 2
}
}
}
function setup() {
createCanvas(500, 500);
}
function draw() {
if ( tela == 0){
telaMenu();
}
if ( tela == 1) {
telaInstrucoes();
}
if ( tela == 2){
telaCreditos();
}
if ( tela == 3){
telaJogar();
}
}