xxxxxxxxxx
151
let mainBG;
let textBG;
let button;
let finaleBG;
let gameState = 'Start Screen';
function startScreen(){
noTint();
background(finaleBG);
fill(185, 159, 102);
textSize(100);
text("Thank You", 50, 200);
text("for Playing!", 60, 300);
tint(255, 220);
image(button, 70, 350, 280, 100);
textSize(40);
text("Back to Title", 85, 415);
/*
tint(255, 150);
image(textBG, 40, 50, 880, 440);
fill(185, 159, 102);
textSize(40);
text("They say music is the vessel of memory,", 100, 130);
text("and memory the muse of music.", 270, 190);
text("Waking up in a field with no recollection,", 100, 250);
text("the musical box in your hand is the only key.", 75, 310)
text("5 notes to play. 6 notes in a song.", 100, 370)
text("And in a song, a memory.", 150, 430);
tint(255, 220);
image(button, 620, 410, 280, 60);
text("N E X T", 675, 455)
}
function intro(){
tint(255, 150);
image(textBG, 40, 50, 880, 440);
fill(185, 159, 102);
textSize(40);
text("They say music is the vessel of memory,", 100, 150);
text("and memory the muse of music.", 75, 200);
text("Waking up in a field with no recollection,", 75, 250);
text("the musical box in your hand is the only key.", 75, 300)
tint(255, 220);
image(button, 620, 410, 280, 60);*/
}
function mainMenu(){
rect(0, 100, 200, 100);
}
function preload(){
mainBG = loadImage('BOTW Vista.jpeg');
textBG = loadImage('Map BG.png');
button = loadImage('BOTW Button.png');
botwFont = loadFont('BOTW Font.otf');
finaleBG = loadImage('Vista.jpg');
}
function setup() {
createCanvas(960, 540);
textFont(botwFont);
}
function draw() {
background(mainBG);
if (gameState == 'Start Screen') {
startScreen();
}
else if (gameState == 'Intro') {
intro();
}
else if (gameState == 'Main Menu') {
mainMenu();
}
}
function mousePressed() {
//For Start Button
if (gameState == 'Start Screen') {
if (340 < mouseX && mouseX < 620 && 380 < mouseY && mouseY < 460){
gameState = 'Intro';
mainMenu();
}
} //For Finish Button
else if (gameState == 'Intro'){
if (620 < mouseX && mouseX < 900 && 410 < mouseY && mouseY < 470){
gameState = 'Main Menu';
intro();
}
}
else if (gameState == 'Main Menu'){
if (620 < mouseX && mouseX < 900 && 410 < mouseY && mouseY < 470){
gameState = 'Start Screen';
intro();
}
}
}
/*let raindrop = [];
class Raindrop{
constructor(){
this.x = random(0, width);
this.y = random(0, -height);
}
rain(){
noStroke();
fill(255);
ellipse(this.x, this.y, random(1, 5), random(1, 5));
}
reset(){
this.speed = random(5, 10);
this.gravity = 1.05;
this.y = this.y + (this.speed * this.gravity);
if (this.y > height) {
this.y = random(0, -height);
this.gravity = 0;
}
}
}
let song;
function setup() {
song = loadSound('Song of Storms.mp3');
createCanvas(600, 400);
background(255, 0, 0);
for(i = 0; i < 200; i++){
raindrop[i] = new Raindrop();
}
}
function mousePressed() {
if (song.isPlaying()) {
// .isPlaying() returns a boolean
song.stop();
background(255, 0, 0);
} else {
song.play();
background(0, 255, 0);
}
}
function draw(){
background(0)
for(i = 0; i < 200; i++) {
raindrop[i].rain();
raindrop[i].reset();
}
}*/