xxxxxxxxxx
119
/*
My final project will be about a character It will be a mix of animation to make one of the characters move to help the other character who is trapped. It will also have a background sound.
4.24.2024
*/
//global scope
var currentSlide = 1;//First Slide
var totalSlides = 4;
var nextSlideActive = false;
var prevSlideActive = false;
//Slide 2
var description = "In my final I will merge the sound sampler project from week 11 and I will use my generative landscape from week 9. I will also make the characters.";
//Slide 3
var interaction = "The user will be allowed to move the characters around the landscape. The characters will need to find 3 circles that are in 3 different colors. They will have to figure out what order will the three color circles will have to be pressed for the hidden door to appear so both characters can walk through the door to finish the game.";
//slide 4
var description2 = "As you can see, there are three hidden circles around the background. Each different color circle will have a ringtone to it once you click it. There will be a hidden code around the landscape as well so you can figure out what order the circle should be pressed. Once, you figure that out and press the circles in order to make the door appear!";
//slide 4
var graphicsExample;
function preload(){
graphicsExample = loadImage("landscape.jpg");
}
function setup() {
createCanvas(600, 600);
}
function mousePressed(){
save("landscape.jpg");
}
function draw() {
background("black");
//first slide
if (currentSlide == 1 ) {
textSize(55);
textFont("Papyrus");
fill("white");
textAlign(CENTER);
stroke("red");
text("Animascape:", 65, 155, 500);
textSize(30);
textFont("Papyrus");
fill("DeepSkyBlue");
text("The Bootleg Version", 75, 275, 500);
text("of", 75, 318, 500);
text("Guess the Color Code", 75, 361,500);
textSize(25);
text("By:Sally",75, 440 ,500);
}
//second slide
if (currentSlide == 2){
textSize(40);
textFont("Cooperplate");
fill("plum");
textAlign(CENTER);
text(description, 65, 125, 500);
}
//third slide
if (currentSlide == 3){
textSize(30);
textFont("Cooperplate");
fill("Palegreen");
textAlign(CENTER);
text(interaction, 65,110,500);
}
//fourth slide: Graphic Example
if (currentSlide == 4){
image(graphicsExample, 50, 130, 500);
textSize(15);
textFont("Cooperplate");
fill("plum");
textAlign(CENTER)
text(description2, 50, 200, 500);
}
nextSlideActive = button(300, 510,60,20, "NEXT"); //Logic Button
prevSlideActive = button(200, 510, 60, 20, "PREV"); //Logic Button
}
function mousePressed(){
if (nextSlideActive && currentSlide < totalSlides) {
currentSlide += 1;
}
if (prevSlideActive && currentSlide > 1){
currentSlide -= 1;
}
}
//Button Logic & Draw Button & Returns if it's Active
function button (x,y,w,h,txt){
var isActive = false;
if (mouseX > x && mouseX < x + w && mouseY > y && mouseY < y + h){
isActive = true;
fill("Gold");
} else {
fill("plum");
}
//fill(GOLD)
rect(x,y,w,h);
textSize(15);
fill(0);
textAlign(LEFT, TOP);
textFont("Papyrus");
text(txt, x + 6, y + 4);
//return button to the main program
return isActive;
}