Final Proj: Quarantine Baking Simulator

sketchDownload
//iris yip
//15-104
//deliverable week 15
//final project

var page = 1; //set up a bunch of different "scenes"
let spatula;


function setup() {
  createCanvas(500, 500);
  
}

function preload(){
  img1 = loadImage("https://i.imgur.com/cAQMiab.png");
  img2 = loadImage("https://i.imgur.com/Uab6uYu.png");
  img3 = loadImage("https://i.imgur.com/usB1pJE.png");
  img4 = loadImage("https://i.imgur.com/Imd0Dek.png");
  img5 = loadImage("https://i.imgur.com/XLEACUR.png");
  img6 = loadImage("https://i.imgur.com/iljGqZW.png");
  img7 = loadImage("https://i.imgur.com/Y2B65ub.png");
  img8 = loadImage("https://i.imgur.com/ZI2Soyy.png");
  
  day1 = loadImage("https://i.imgur.com/TPgUWUu.png");
  day3 = loadImage("https://i.imgur.com/XwD89x3.png");
  day4 = loadImage("https://i.imgur.com/i58a6SY.png");
  day6 = loadImage("https://i.imgur.com/WIZ958Z.png");
  day7 = loadImage("https://i.imgur.com/9f5exQ8.png");
  day8 = loadImage("https://i.imgur.com/fWXxfYN.png");
  
  fin = loadImage("https://i.imgur.com/IDq3zRs.png");
  die = loadImage("https://i.imgur.com/smkS7Ca.png");
  
  //spatula
  
  spatula1= loadImage("https://i.imgur.com/FMitxk1.png");
  
  //knife
  
  knife1 = loadImage("https://i.imgur.com/a9yMiM4.png");
  
}

function draw() { //scenes
  
//page 1
  if (page == 1) {
  image(img1, 0, 0);
  }

//page 2
  else if (page == 2) {
  image(img2,0,0);
  }

//page 3
  else if (page == 3) {
  image(img3,0,0);
  }
  
//page 4
  else if (page == 4){
  image(img4,0,0);
  }
  
//page 5
  else if(page ==5){
  image(img5,0,0);
    
  image(spatula1,mouseX,mouseY);
  }

//page 6
  else if(page ==6){
  image(img6,0,0);
  }

  else if(page ==7){
  image(day1,0,0);
  }
  
  else if(page ==8){
  image(day3,0,0);
  }
  
  else if(page ==9){
  image(day4,0,0);
  }
  
  else if(page ==10){
  image(day6,0,0);
  }
  
  else if(page ==11){
  image(day7,0,0);
  }

  else if(page ==12){
  image(day8,0,0);
  }
  
  else if(page ==13){
  image(img7,0,0);
  }
  
  else if(page ==14){
  image(img8,0,0);
    
  image(knife1,mouseX,mouseY);
  }


//bad end
  else if (page == 20) {
    image(die,0,0);
  }
}


function mousePressed() {
  // PAGE 1 COMMANDS
  if (page == 1) {
    if (mouseX > 90 & mouseX < 300 && mouseY > 220 && mouseY < 400) {
     page = 2; //proceed forwards into the game
    }
    else if (mouseX > 300 & mouseX < 400 && mouseY > 350 && mouseY < 400) {
     page = 1; //stays the same
    }
  }
  
  //PAGE 3 COMMANDS
  if (page ==3) {
    if(mouseX > 350 & mouseY > 200){
      page = 4; //proceed forward
    }
  }
  //page 4
  if (page ==4){
    if(mouseX>400 & mouseY> 220){
      page = 5;
    }
  }
  //page 5
  if (page ==5){
    if(mouseX>150 & mouseX<250 && mouseY>50 && mouseY<250){
      page = 6
    }
  }
  //page 6
  if(page ==6){
    if(mouseX > 400 && mouseX<480 && mouseY> 60 && mouseY<200){
      page = 7;
    }
  }
  //page 7
  if(page ==7){
    if(mouseX>400 & mouseX<480 && mouseY> 60 && mouseY<200){
      page = 8;
    }
  }
  
  if(page ==8){
    if(mouseX>400 & mouseY > 60){
      page =9;
    }
  }
  if(page ==9){
    if(mouseX>50 & mouseX<480 && mouseY>60 && mouseY<300){
      page= 13;
    }
  }
  if(page ==13){
    if(mouseX>10 & mouseY>10){
      page= 14;
    }
  }
  if(page ==14){
    if(mouseX>130 & mouseX < 250 && mouseY> 150 && mouseY<200){
      page=15;
    }
  }
}


function keyPressed(){
  //PAGE 2 COMMNADS
  if(page==2){
    if(key=='a'){
    page =3; //proceed forwards
    }
    else if(key != 'a'){
    page =20; //dies
    }
  }
  
  //day1
  if(page== 7 & 8 && 9 && 11 && 12){
    if(key=='k'){
    page = 20
    }
    else if(key != 'k'){
    page =20;
    }
  }
  
  //last step
  if(page ==15){
    if(key=='360'){
    page = fin
    }
    else if(key !='360'){
    page =20;
    }
  }
}

For my final project, I wanted to make a ‘point-and-click’ adventure style game about baking during quarantine, which would act like a little tutorial adventure of sorts. Growing up, I played a lot of Cooking Mama on the Nintendo, which is where the primary inspiration for this game came from. The instructions for each step are given on the screen, which ranges from clicking on certain parts of the screen to pressing a key and clicking and dragging.

Overall, there were a few parts that I could not get to work (certain scenes being skipped, etc.) but it was really cool to try to replicate the type of mini-game that I would play a lot when I was younger! If I had more time, I’d go back and clean up the code so that it would run more efficiently, and also add in more complex scenes and a grading scale/system rather than the instant death mechanic function.

Leave a Reply