xxxxxxxxxx
// The starting scenes are only the first versions.
// Evaine: background IP is Roco Kingdom.
// Evaine: 1. Press "space" to start.
// Evaine: 2. Press "e" to go to my first scene.
// Evaine: 3. EITHER find the 5 differences then go to my second scene OR fail in a certain amount of time then go to lose scene.
// Evaine: 4. Press "f" to go to my second scene.
// Evaine: 5. Click the 5 objects then double click the middle one to go to win scene.
var titlefont;
function preload() {
titlefont = loadFont('Gypsy Curse.ttf');
startimage = loadImage('haunted.jpg'); // if you find a good quality pic feel free to replace this
E_background1 = loadImage('E_Hall.jpg'); // Evaine: background of SCENE 3E
E_background2 = loadImage('E_Hall_Again.jpg'); // Evaine: background of SCENE 4E
E_sound1 = loadSound('E_Sound1.mp3'); // Evaine: sound of SCENE 3E
E_sound2 = loadSound('E_Sound2.mp3'); // Evaine: sound of SCENE 4E
loadImage('E_Candle1.png'); // Evaine: image of left candle in SCENE 3E and its src below
E_srccandle1 = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Candle1.png';
loadImage('E_Candle2.png'); // Evaine: image of right candle in SCENE 3E and its src below
E_srccandle2 = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Candle2.png';
loadImage('E_Broom.png'); // Evaine: image of broom in SCENE 3E and its src below
E_srcbroom = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Broom.png';
loadImage('E_Carpet.png'); // Evaine: image of carpet in SCENE 3E and its src below
E_srccarpet = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Carpet.png';
loadImage('E_Sword.png'); // Evaine: image of sword in SCENE 3E and its src below
E_srcsword = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Sword.png';
loadImage('E_Flame.png'); // Evaine: image of flame in SCENE 3E and its src below
E_srcflame = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Flame.png';
loadImage('E_Flask.png'); // Evaine: image of flask in SCENE 4E and its src below
E_srcflask = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Flask.png';
loadImage('E_Picture.png'); // Evaine: image of picture in SCENE 4E and its src below
E_srcpicture = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Picture.png';
loadImage('E_Coffin.png'); // Evaine: image of coffin in SCENE 4E and its src below
E_srccoffin = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Coffin.png';
loadImage('E_Cage.png'); // Evaine: image of cage in SCENE 4E and its src below
E_srccage = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Cage.png';
loadImage('E_Pen.png'); // Evaine: image of pen in SCENE 4E and its src below
E_srcpen = 'https://deckard.openprocessing.org/user285108/visual1395888/ha535128fd5bbe92fbca45d81b025b2f0/E_Pen.png';
}
function setup() {
createCanvas(windowWidth, windowHeight);
background(startimage);
textAlign(CENTER); textSize(130); textFont(titlefont);
fill(180);
text('Will You Survive?', 400, 260);
textSize(80);
text('Evaine, Justine, Kai, Neha', 400, 400);
textSize(40);
text('(Make sure your sound is not loud.)', 400, 460);
E_candle1 = createImg(E_srccandle1, ''); // Evaine: button of left candle in SCENE 3E
E_candle1.position(80, 528); // Evaine: position of left candle in SCENE 3E
E_candle1.hide();
E_candle2 = createImg(E_srccandle2, ''); // Evaine: button of left candle in SCENE 3E
E_candle2.position(804, 528); // Evaine: position of left candle in SCENE 3E
E_candle2.hide();
E_broom = createImg(E_srcbroom, ''); // Evaine: button of broom in SCENE 3E
E_broom.position(1188, 312); // Evaine: position of broom in SCENE 3E
E_broom.hide();
E_carpet = createImg(E_srccarpet, ''); // Evaine: button of carpet in SCENE 3E
E_carpet.position(1018, 448); // Evaine: position of carpet in SCENE 3E
E_carpet.hide();
E_sword = createImg(E_srcsword, ''); // Evaine: button of sword in SCENE 3E
E_sword.position(1324, 296); // Evaine: position of sword in SCENE 3E
E_sword.hide();
E_flame = createImg(E_srcflame, ''); // Evaine: button of flame in SCENE 3E
E_flame.position(788, 380); // Evaine: position of flame in SCENE 3E
E_flame.hide();
E_flask = createImg(E_srcflask, ''); // Evaine: button of flask in SCENE 4E
E_flask.position(64, 580); // Evaine: position of flask in SCENE 4E
E_flask.hide();
E_picture = createImg(E_srcpicture, ''); // Evaine: button of picture in SCENE 4E
E_picture.position(318, 152); // Evaine: position of picture in SCENE 4E
E_picture.hide();
E_coffin = createImg(E_srccoffin, ''); // Evaine: button of coffin in SCENE 4E
E_coffin.position(600, 400); // Evaine: position of coffin in SCENE 4E
E_coffin.hide();
E_cage = createImg(E_srccage, ''); // Evaine: button of cage in SCENE 4E
E_cage.position(1014, 178); // Evaine: position of cage in SCENE 4E
E_cage.hide();
E_pen = createImg(E_srcpen, ''); // Evaine: button of pen in SCENE 4E
E_pen.position(1248, 386); // Evaine: position of pen in SCENE 4E
E_pen.hide();
}
function keyPressed() {
if(key == ' ') {
scene2();
}
if(key === 'e') { // Evaine: click "e" to go to SCENE 3E
E_scene3(); // Evaine: function in SCENE 3E
}
if (key === 'f') { // Evaine: click "f" to go to SCENE 4E (Question)
E_scene4(); // Evaine: function in SCENE 4E
}
}
function scene2(){
background(0);
textSize(80);
text('You open the front door and...', windowWidth/2, 100);
textAlign(LEFT);
text('walk straight ahead.', 200, 230);
fill(160, 0, 0);
text('[Press e]', 645, 230);
fill(180);
text('go down the left hallway.', 200, 360);
fill(160, 0, 0);
text('[Press j]', 740, 360);
fill(180);
text('go down the right hallway.', 200, 490);
fill(160, 0, 0);
text('[Press k]', 760, 490);
fill(180);
text('stay where you are.', 200, 620);
fill(160, 0, 0);
text('[Press n]', 630, 620);
}
function E_scene3() {
E_sound1.play();
background(0);
image(E_background1, 0, -84, 1440, 900); // Evaine: background of SCENE 3E
textAlign(CENTER);
textSize(80);
fill(180);
text('Find the Differences (Click on the Right Side)', 720, 100);
text('Discover 5 or Die (Press f Only After you Discover All!)', 720, 675);
E_candle1.show();
E_candle2.show();
E_candle2.mouseClicked(E_draw1); // Evaine: function of candle in SCENE 3E
E_broom.show();
E_broom.mouseClicked(E_draw2); // Evaine: function of broom in SCENE 3E
E_carpet.show();
E_carpet.mouseClicked(E_draw3); // Evaine: function of carpet in SCENE 3E
E_sword.show();
E_sword.mouseClicked(E_draw4); // Evaine: function of sword in SCENE 3E
E_flame.show();
E_flame.mouseClicked(E_draw5); // Evaine: function of flame in SCENE 3E
if(E_candle2.mouseClicked & E_broom.mouseClicked) E_scene4();
}
function E_draw1() {
stroke('red');
noFill();
circle(106, 560, 75); // Evaine: circle left candle in SCENE 3E
circle(834, 560, 75); // Evaine: circle right candle in SCENE 3E
}
function E_draw2() {
stroke('red');
noFill();
circle(510, 376, 132); // Evaine: circle left broom in SCENE 3E
circle(1228, 376, 132); // Evaine: circle rigt broom in SCENE 3E
}
function E_draw3() {
stroke('red');
noFill();
circle(372, 486, 140); // Evaine: circle left carpet in SCENE 3E
circle(1090, 486, 140); // Evaine: circle right carpet in SCENE 3E
}
function E_draw4() {
stroke('red');
noFill();
circle(640, 370, 140); // Evaine: circle left sword in SCENE 3E
circle(1360, 370, 140); // Evaine: circle right sword in SCENE 3E
}
function E_draw5() {
stroke('red');
noFill();
circle(112, 426, 104); // Evaine: circle left flame in SCENE 3E
circle(832, 426, 104); // Evaine: circle right flame in SCENE 3E
}
function E_scene4() {
E_candle1.hide();
E_candle2.hide();
E_broom.hide();
E_carpet.hide();
E_sword.hide();
E_flame.hide();
E_sound1.stop();
E_sound2.play();
background(0);
image(E_background2, 0, 0, 1440, 800); // Evaine: background of SCENE 4E
textAlign(CENTER);
textSize(80);
noStroke();
fill(180);
text('Click the 5 Objects to Read the Messages', 720, 680);
E_flask.show();
E_flask.mouseClicked(E_draw6); // Evaine: function of flask in SCENE 4E
E_picture.show();
E_picture.mouseClicked(E_draw7); // Evaine: function of picture in SCENE 4E
E_coffin.show();
E_coffin.mouseClicked(E_draw8); // Evaine: function of coffin in SCENE 4E
E_coffin.doubleClicked(scene5); // Evaine: go to SCENE 5 when double clicked
E_cage.show();
E_cage.mouseClicked(E_draw9); // Evaine: function of cage in SCENE 4E
E_pen.show();
E_pen.mouseClicked(E_draw10); // Evaine: function of pen in SCENE 4E
}
function E_draw6() {
textAlign(LEFT);
textSize(40);
noStroke();
fill(160, 0, 0);
text('Do you really want to be immortal?', 48, 560); // Evaine: message of flask
}
function E_draw7() {
textAlign(CENTER);
textSize(40);
noStroke();
fill(160, 0, 0);
text('The portrait of the next Count will be here.', 348, 136); // Evaine: message of picture
}
function E_draw8() {
textAlign(CENTER);
textSize(40);
noStroke();
fill(160, 0, 0);
text('Promise me! Leave here right now and never come back again!', 708, 348); // Evaine: message of coffin
text('Double click the coffin.', 708, 388); // Evaine: message of win
}
function E_draw9() {
textAlign(CENTER);
textSize(40);
noStroke();
fill(160, 0, 0);
text('A bird in the cage... A bat in the cage... A soul in the cage...', 1048, 168); // Evaine: message of cage
}
function E_draw10() {
textAlign(RIGHT);
textSize(40);
noStroke();
fill(160, 0, 0);
text('He used the pen. He will use the pen? He is using the pen!', 1400, 468); // Evaine: message of pen
}
function scene5() { // win
E_candle1.hide();
E_candle2.hide();
E_broom.hide();
E_carpet.hide();
E_sword.hide();
E_flame.hide();
E_flask.hide();
E_picture.hide();
E_coffin.hide();
E_cage.hide();
E_pen.hide();
E_sound1.stop();
E_sound2.stop();
background(0);
textAlign(CENTER); textSize(100); textFont(titlefont);
noStroke();
fill(180);
text('You got out of the haunted house and survived!', windowWidth/2, windowHeight/2);
}