xxxxxxxxxx
var soil
var seed
var sprout
var smallplant
var bigplant
var music
let pagenum = 1;
function preload(){
soil = loadImage('soil.jpeg')
seed = loadImage('seed.jpeg')
sprout = loadImage('sproute.jpg')
smallplant = loadImage('smallplant.jpg')
bigplant = loadImage('bigplant.jpg')
music = loadSound('Lite Saturation - Calm Room Piano.mp3')
}
function setup() {
createCanvas(400, 400);
music.play();
}
function draw() {
background(11, 99, 54);
if (pagenum == 1) draw_soil();
if (pagenum == 2) draw_seed();
if (pagenum == 3) draw_sprout();
if (pagenum == 4) draw_smallplant();
if (pagenum == 5) draw_bigplant();
}
function draw_soil(){
imageMode(CENTER)
image(soil,200,200,200,200)
textSize(25)
text('Starting a garden from scratch',30,350)
}
function draw_seed(){
imageMode(CENTER)
image(seed,200,200,200,200)
textSize(30)
text('I plant my seeds',100,350)
}
function draw_sprout(){
imageMode(CENTER)
image(sprout,200,200,200,200)
textSize(25)
text('Something is starting to grow',50,350)
}
function draw_smallplant(){
imageMode(CENTER)
image(smallplant,200,200,200,200)
textSize(30)
text('Sprouting beautifully',60,350)
}
function draw_bigplant(){
imageMode(CENTER)
image(bigplant,200,200,200,200)
textSize(30)
text('My garden is in bloom',60,350)
}
function keyPressed(){
if (key == '1'){
pagenum = +1 }
if(key == '2'){
pagenum = 2;
}
if(key == '3'){
pagenum = 3;
}
if (key == '4'){
pagenum = 4
}
if (key == '5'){
pagenum = 5
}
}