xxxxxxxxxx
75
let state = 0;
const INSTRUCTIONS = 0;
const CHOOSING = 1;
const BREATHING = 2;
const MANTRAS = 3;
const JOURNALING = 4;
let instructionsImage;
function preload(){
instructionsImage = loadImage("background.jpg");
choosingImage = loadImage("background.jpg");
}
function setup() {
createCanvas(400, 400);
image(backgroundImage,0,0);
}
function mousePressed() {
}
function draw() {
switch (state) {
case INSTRUCTIONS:
displayInstructions();
break;
case CHOOSING:
displayChoosing();
break;
case BREATHING:
displayBreathing();
break;
case MANTRAS:
displayMantras();
break;
case JOURNALING:
displayJournaling();
break;
}
}
function keyPressed() {
if (keyCode === ENTER && state === INSTRUCTIONS) {
state = CHOOSING;
}
}
function displayInstructions() {
//image(BackgroundImage)
// text("choose your whatever");
// text("press 'e' to continue");
}
function displayChoosing() {
image(cloudImage);
text("choose your whatever");
// display the buttons
}
function displayBreathing() {
image(cloudImage);
text("Do the breathing exercise as long as you wish, following inhale-hold-exhale pattern");
// display the buttons
}