xxxxxxxxxx
var image1;
var image2;
var image3;
var image4;
var image5;
var M5;
var imagenum = 1;
function preload(){
image1 = loadImage("image1.jpg");
image2 = loadImage("image2.jpg");
image3 = loadImage("image3.jpg");
image4 = loadImage("image4.jpg");
image5 = loadImage("image5.jpg");
M5 = loadSound("M5.mp3");
}
function keyPressed(){
M5.play();
M5.playMode('restart');
}
if(key == ' '){
M5.play('M5.mp3');
}
if(key == '+'){
M5.rate(2)
}
if(key == '-'){
M5.rate(0.5)
}
function setup() {
createCanvas(400, 400);
rectMode(CENTER);
imageMode(CENTER);
}
function draw() {
if(imagenum == 1){
background(0);
image(image1,200,200,300,400);
print("1")
fill(255)
text("Officially a Spelmanite", 100, 185)
}
if(imagenum == 2){
background(0);
image(image2,200,200,300,400);
print("2")
text("first time drinking beer...jk its ginger beer", 87, 185)
}
if(imagenum == 3){
background(0);
image(image3,200,200,300,400);
print("3")
fill(255)
text("Officially a woman of NCNW!!", 70, 185)
}
if(imagenum == 4){
background(0);
image(image4,200,200,300,400);
print("4")
text("Wednesdays are my fav <3 ", 70, 185)
}
if(imagenum == 5){
background(0);
image(image5,200,200,300,400);
print("5")
fill(255)
text("Excited for the next few years!!", 90, 190)
}
}
function keyPressed(){
if(keyCode == RIGHT_ARROW){
imagenum = imagenum+1;
}
else if(keyCode == LEFT_ARROW){
imagenum = 1;
}
}