xxxxxxxxxx
531
//MOBILE SETUP
// function touchStarted(){
// return false;
// }
// function touchMoved(){
// return false;
// }
// function touchEnded(){
// return false;
// }
//INTRO SCREEN SETUP
var screen = 1;
var globes = [];
var globeNum = 0;
var titles = [];
var titleNum = 0;
var crosshair;
var title;
//PAGE A SETUP
var buttons1;
//balint1
var balint1 = [];
var balint1Frame = 0;
var balint1Delay = 100;
var nextBalint1 = 0;
//yug1
var yug1 = [];
var yug1Frame = 0;
var yug1Delay = 100;
var nextYug1 = 0;
//balint2
var balint2 = [];
var balint2Frame = 0;
var balint2Delay = 100;
var nextBalint2 = 0;
//yug2
var yug2 = [];
var yug2Frame = 0;
var yug2Delay = 100;
var nextYug2 = 0;
//PAGE B SETUP
var buttons2;
var b1 = [];
var b1Frame = 0;
var b1Delay = 1000;
var nextB1 = 0;
//b2
var b2 = [];
var b2Frame = 0;
var b2Delay = 1000;
var nextB2 = 0;
//b3
var b3 = [];
var b3Frame = 0;
var b3Delay = 1000;
var nextB3 = 0;
//head1
var h1 = [];
var h1Frame = 0;
var h1Delay = 50;
var nextH1 = 0;
//head2
var h2 = [];
var h2Frame = 0;
var h2Delay = 50;
var nextH2 = 0;
//head3
var h3 = [];
var h3Frame = 0;
var h3Delay = 50;
var nextH3 = 0;
//PAGE C SETUP
//head1
var d1 = [];
var d1Frame = 0;
var d1Delay = 50;
var nextD1 = 0;
//c
var c1 = [];
var c1Frame = 0;
var c1Delay = 100;
var nextC1 = 0;
//SMOKE SETUP
var bigSmoke = [];
var smallSmoke = [];
//OVER FUNCTION
function overSmoke(x, y, radius) {
if (dist(x, y, mouseX, mouseY) < radius) {
return true;
} else {
return false;
}
}
//SMOKE FUNCTION
function Smoke1() {
this.x = random(0, width);
this.y = random(0, height);
this.radius = random(5, 100);
this.display = function() {
noStroke();
fill(255, 5);
ellipse(this.x, this.y, this.radius, this.radius);
},
this.move = function() {
this.speed = 100;
if (overSmoke(this.x, this.y, this.radius)) {
this.x = this.x + random(-this.speed, this.speed);
this.y = this.y + random(-this.speed, this.speed);
}
this.x += random(-1, 1);
this.y += random(-1, 1);
}
}
function setup() {
createCanvas(750, 1124);
//createCanvas(displayWidth, displayHeight);
frameRate(10);
//SMOKE INTRO
for (var z = 0; z < 1500; z++) {
bigSmoke[z] = new Smoke1();
}
}
function preload() {
//CURSOR
crosshair = loadImage("cursor.png");
title = loadImage("title.png");
//TITLE
titles[0] = loadImage("Title-27.png");
titles[1] = loadImage("Title-28.png");
titles[2] = loadImage("Title-29.png");
titles[3] = loadImage("Title-30.png");
titles[4] = loadImage("Title-31.png");
titles[5] = loadImage("Title-32.png");
titles[6] = loadImage("Title-33.png");
titles[7] = loadImage("Title-34.png");
titles[8] = loadImage("Title-35.png");
titles[9] = loadImage("Title-36.png");
titles[10] = loadImage("Title-37.png");
//GLOBE PAGE
// globes[0] = loadImage("Globes2.png");
// globes[1] = loadImage("Globes3.png");
// globes[2] = loadImage("Globes4.png");
// globes[3] = loadImage("Globes5.png");
// globes[4] = loadImage("Globes6.png");
// globes[5] = loadImage("Globes7.png");
// globes[6] = loadImage("Globes8.png");
// globes[7] = loadImage("Globes9.png");
//PAGE A
buttons1 = loadImage("buttons1.png");
balint1[0] = loadImage("balint1.1.png");
balint1[1] = loadImage("balint1.2.png");
balint1[2] = loadImage("balint1.3.png");
balint1[3] = loadImage("balint1.4.png");
balint1[4] = loadImage("balint1.5.png");
//yug1
yug1[0] = loadImage("yugena1.1.png");
yug1[1] = loadImage("yugena1.2.png");
yug1[2] = loadImage("yugena1.3.png");
yug1[3] = loadImage("yugena1.4.png");
yug1[4] = loadImage("yugena1.5.png");
//balint2
balint2[0] = loadImage("balint2.1.png");
balint2[1] = loadImage("balint2.2.png");
balint2[2] = loadImage("balint2.3.png");
balint2[3] = loadImage("balint2.4.png");
balint2[4] = loadImage("balint2.5.png");
//yug2
yug2[0] = loadImage("yugena2.1.png");
yug2[1] = loadImage("yugena2.2.png");
yug2[2] = loadImage("yugena2.3.png");
yug2[3] = loadImage("yugena2.4.png");
yug2[4] = loadImage("yugena2.5.png");
//PAGE B
buttons2 = loadImage("buttons2.png");
b1[0] = loadImage("b1.1.png");
b1[1] = loadImage("b1.2.png");
//b2
b2[0] = loadImage("b2.1.png");
b2[1] = loadImage("b2.2.png");
//b3
b3[0] = loadImage("b3.1.png");
b3[1] = loadImage("b3.2.png");
//h1
h1[0] = loadImage("head1.1.png");
h1[1] = loadImage("head1.2.png");
h1[2] = loadImage("head1.3.png");
h1[3] = loadImage("head1.4.png");
h1[4] = loadImage("head1.5.png");
h1[5] = loadImage("head1.6.png");
//h2
h2[0] = loadImage("head2.1.png");
h2[1] = loadImage("head2.2.png");
h2[2] = loadImage("head2.3.png");
h2[3] = loadImage("head2.4.png");
h2[4] = loadImage("head2.5.png");
h2[5] = loadImage("head2.6.png");
//h3
h3[0] = loadImage("head3.1.png");
h3[1] = loadImage("head3.2.png");
h3[2] = loadImage("head3.3.png");
h3[3] = loadImage("head3.4.png");
h3[4] = loadImage("head3.5.png");
//PAGE C
//d1
d1[0] = loadImage("doll-02.png");
d1[1] = loadImage("doll-03.png");
d1[2] = loadImage("doll-04.png");
d1[3] = loadImage("doll-05.png");
d1[4] = loadImage("doll-06.png");
d1[5] = loadImage("doll-07.png");
d1[6] = loadImage("doll-08.png");
d1[7] = loadImage("doll-09.png");
d1[8] = loadImage("doll-10.png");
d1[9] = loadImage("doll-11.png");
d1[10] = loadImage("doll-12.png");
d1[11] = loadImage("doll-13.png");
d1[12] = loadImage("doll-14.png");
d1[13] = loadImage("doll-15.png");
d1[14] = loadImage("doll-16.png");
d1[15] = loadImage("doll-17.png");
d1[16] = loadImage("doll-18.png");
d1[17] = loadImage("doll-19.png");
d1[18] = loadImage("doll-20.png");
d1[19] = loadImage("doll-21.png");
//c1
c1[0] = loadImage("fin1.1.png");
c1[1] = loadImage("fin1.3.png");
// c1[2] = loadImage("end1.3.png");
// c1[3] = loadImage("end1.4.png");
// c1[4] = loadImage("end1.5.png");
// c1[5] = loadImage("end1.6.png");
}
//TITLE GIF
function titleScreen() {
image(titles[titleNum], 0, 0);
titleNum += 1;
if (titleNum >= titles.length) {
titleNum = 0;
}
}
//GLOBE GIF
// function globeScreen() {
// image(globes[globeNum], 0, 0);
// globeNum += 1;
// if (globeNum >= globes.length) {
// globeNum = 0;
// }
// }
//HOME
function home() {
for (var z = 0; z < bigSmoke.length; z++) {
bigSmoke[z].move();
bigSmoke[z].display();
}
//image(crosshair, mouseX - 375, mouseY - 562);
//globeScreen();
titleScreen();
}
//balint1 GIF
function balint1gif() {
image(balint1[balint1Frame], 0, 0);
if (millis() > nextBalint1) {
balint1Frame = balint1Frame + 1;
if (balint1Frame >= balint1.length) {
balint1Frame = 0;
}
nextBalint1 = millis() + balint1Delay;
}
}
//yug1 GIF
function yug1gif() {
image(yug1[yug1Frame], 0, 0);
if (millis() > nextYug1) {
yug1Frame = yug1Frame + 1;
if (yug1Frame >= yug1.length) {
yug1Frame = 0;
}
nextYug1 = millis() + yug1Delay;
}
}
//balint2 GIF
function balint2gif() {
image(balint2[balint2Frame], 0, 0);
if (millis() > nextBalint2) {
balint2Frame = balint2Frame + 1;
if (balint2Frame >= balint2.length) {
balint2Frame = 0;
}
nextBalint2 = millis() + balint2Delay;
}
}
//yug2 GIF
function yug2gif() {
image(yug2[yug2Frame], 0, 0);
if (millis() > nextYug2) {
yug2Frame = yug2Frame + 1;
if (yug2Frame >= yug2.length) {
yug2Frame = 0;
}
nextYug2 = millis() + yug2Delay;
}
}
//PAGE B
//b1 GIF
function b1gif() {
image(b1[b1Frame], 0, 0);
if (millis() > nextB1) {
b1Frame = b1Frame + 1;
if (b1Frame >= b1.length) {
b1Frame = 0;
}
nextB1 = millis() + b1Delay;
}
}
//b2 GIF
function b2gif() {
image(b2[b2Frame], 0, 0);
if (millis() > nextB2) {
b2Frame = b2Frame + 1;
if (b2Frame >= b2.length) {
b2Frame = 0;
}
nextB2 = millis() + b2Delay;
}
}
//b3 GIF
function b3gif() {
image(b3[b3Frame], 0, 0);
if (millis() > nextB3) {
b3Frame = b3Frame + 1;
if (b3Frame >= b3.length) {
b3Frame = 0;
}
nextB3 = millis() + b3Delay;
}
}
//h1 GIF
function h1gif() {
image(h1[h1Frame], 0, 0);
if (millis() > nextH1) {
h1Frame = h1Frame + 1;
if (h1Frame >= h1.length) {
h1Frame = 0;
}
nextH1 = millis() + h1Delay;
}
}
//h2 GIF
function h2gif() {
image(h2[h2Frame], 0, 0);
if (millis() > nextH2) {
h2Frame = h2Frame + 1;
if (h2Frame >= h2.length) {
h2Frame = 0;
}
nextH2 = millis() + h2Delay;
}
}
//h3 GIF
function h3gif() {
image(h3[h3Frame], 0, 0);
if (millis() > nextH3) {
h3Frame = h3Frame + 1;
if (h3Frame >= h3.length) {
h3Frame = 0;
}
nextH3 = millis() + h3Delay;
}
}
//PAGE C
//c1 GIF
function c1gif() {
image(c1[c1Frame], 0, 0);
if (millis() > nextC1) {
c1Frame = c1Frame + 1;
if (c1Frame >= c1.length) {
c1Frame = 0;
}
nextC1 = millis() + c1Delay;
}
}
// //d1 GIF
function d1gif() {
image(d1[d1Frame], 0, 0);
if (millis() > nextD1) {
d1Frame = d1Frame + 1;
if (d1Frame >= d1.length) {
d1Frame = 0;
}
nextD1 = millis() + d1Delay;
}
}
function draw() {
background(0);
//noCursor();
//SMOKE INTRO
if (screen == 1) {
d1gif();
home();
} else if (screen == 2) {
balint1gif();
image(buttons1, 0, 0);
} else if (screen == 3) {
yug1gif();
image(buttons1, 0, 0);
} else if (screen == 4) {
balint2gif();
image(buttons1, 0, 0);
} else if (screen == 5) {
yug2gif();
image(buttons1, 0, 0);
} else if (screen == 6) {
b1gif();
image(buttons2, 0, 0);
h1gif();
} else if (screen == 7) {
b2gif();
image(buttons2, 0, 0);
h2gif();
} else if (screen == 8) {
b3gif();
image(buttons2, 0, 0);
h3gif();
} else if (screen == 9) {
c1gif();
}
}
//SCREEN PRESSED
function mousePressed() {
//if (mouseX > s1x && mouseX < s1x + s1w && mouseY > s1y && mouseY < s1y + s1h) {
//screen = 2;
if (screen == 1) {
if (mouseY > 500) {
screen = 2;
}
} else
if (screen == 2) {
screen = 3;
if (mouseX > 443 && mouseX < 585 && mouseY > 761 && mouseY < 898) {
screen = 6;
} else if (mouseX > 585 && mouseX < 717 && mouseY > 761 && mouseY < 898) {
screen = 9;
}
} else
if (screen == 3) {
screen = 4;
if (mouseX > 443 && mouseX < 585 && mouseY > 761 && mouseY < 898) {
screen = 6;
} else if (mouseX > 585 && mouseX < 717 && mouseY > 761 && mouseY < 898) {
screen = 9;
}
} else
if (screen == 4) {
screen = 5;
if (mouseX > 443 && mouseX < 585 && mouseY > 761 && mouseY < 898) {
screen = 6;
} else if (mouseX > 585 && mouseX < 717 && mouseY > 761 && mouseY < 898) {
screen = 9;
}
} else
if (screen == 5) {
screen = 2;
if (mouseX > 443 && mouseX < 585 && mouseY > 761 && mouseY < 898) {
screen = 6;
} else if (mouseX > 585 && mouseX < 717 && mouseY > 761 && mouseY < 898) {
screen = 9;
}
} else
if (screen == 6) {
screen = 7;
if (mouseX > 546 && mouseX < 692 && mouseY > 157 && mouseY < 299) {
screen = 9;
}
} else
if (screen == 7) {
screen = 8;
if (mouseX > 546 && mouseX < 692 && mouseY > 157 && mouseY < 299) {
screen = 9;
}
} else
if (screen == 8) {
screen = 6;
if (mouseX > 546 && mouseX < 692 && mouseY > 157 && mouseY < 299) {
screen = 9;
}
} else
if (screen == 9) {
if (mouseX > 29.5 && mouseX < 172 && mouseY > 721 && mouseY < 857) {
screen = 6;
} else if (mouseX > 29.5 && mouseX < 172 && mouseY > 857 && mouseY < 1005) {
screen = 1;
}
}
}