class Burger {
Burger() {
//set the original location of the individual burgers
b1location = new PVector(-100, 200);
b2location = new PVector(-100, 200);
b3location = new PVector(-100, 200);
b4location = new PVector(-100, 200);
//set the starting velocity
b1velocity = new PVector(0, 0);
b2velocity = new PVector(0, 0);
b3velocity = new PVector(0, 0);
b4velocity = new PVector(0, 0);
}
//print the ellipses made to look like the top-down perspective of the burgers
//while also checking if they went to far,
//and if the player succesfully applied the right condiment
void makeBurger1() {
burgerSpawnRandomizer = random(500, 15000);
if (b1location.x > 500) {
b1location.x = -100;
Burger1IsReady = false;
}
fill(255, 207, 17);
ellipse(b1location.x, conveytorHeights[0], 35, 35);
fill(60, 50, 40);
ellipse(b1location.x, conveytorHeights[0], 30, 30);
if (Burger1IsReady) {
fill(255, 207, 17);
ellipse(b1location.x, conveytorHeights[0], 25, 25);
}
}
void makeBurger2() {
burgerSpawnRandomizer = random(500, 5000);
if (b2location.x > 500) {
b2location.x = -100;
Burger2IsReady = false;
}
fill(255, 207, 17);
ellipse(b2location.x, conveytorHeights[1], 35, 35);
fill(60, 50, 40);
ellipse(b2location.x, conveytorHeights[1], 30, 30);
if (Burger2IsReady) {
fill(255, 207, 17);
ellipse(b2location.x, conveytorHeights[1], 25, 25);
}
}
void makeBurger3() {
burgerSpawnRandomizer = random(500, 15000);
if (b3location.x > 500) {
b3location.x = -100;
Burger3IsReady = false;
}
fill(255, 207, 17);
ellipse(b3location.x, conveytorHeights[2], 35, 35);
fill(60, 50, 40);
ellipse(b3location.x, conveytorHeights[2], 30, 30);
if (Burger3IsReady) {
fill(255, 207, 17);
ellipse(b3location.x, conveytorHeights[2], 25, 25);
}
}
void makeBurger4() {
burgerSpawnRandomizer = random(500, 15000);
if (b4location.x > 500) {
b4location.x = -100;
Burger4IsReady = false;
}
fill(255, 207, 17);
ellipse(b4location.x, conveytorHeights[3], 35, 35);
fill(60, 50, 40);
ellipse(b4location.x, conveytorHeights[3], 30, 30);
if (Burger4IsReady) {
fill(255, 207, 17);
ellipse(b4location.x, conveytorHeights[3], 25, 25);
}
}
}class Condiments {
//keep track of the current condiment selected by the player
int currentCondiment;
//keep track of the needed condiments by each conveytor belt
int neededCondiment1;
int neededCondiment2;
int neededCondiment3;
int neededCondiment4;
//randomize the condiments each conveytor needs everytime the program is run
int neededCondimentRandomizer1 = (int) random(1, 4);
int neededCondimentRandomizer2 = (int) random(1, 4);
int neededCondimentRandomizer3 = (int) random(1, 4);
int neededCondimentRandomizer4 = (int) random(1, 4);
Condiments() {
}
//check if ketchup was applied
void ketchup() {
fill(240, 20, 20);
rectMode(CENTER);
rect(350, 350, 15, 30);
rect(350, 367, 10, 4);
triangle(350, 376, 353, 369, 347, 369);
if (currentCondiment == 1) {
fill(240, 20, 20);
rectMode(CENTER);
rect(mouseX, mouseY, 15, 30);
rect(mouseX, mouseY+17, 10, 4);
triangle(mouseX, mouseY+26, mouseX+3, mouseY+19, mouseX-3, mouseY +19);
}
}
// check if mustard was applied
void mustard() {
fill(255, 245, 50);
rectMode(CENTER);
rect(320, 350, 15, 30);
rect(320, 367, 10, 4);
triangle(320, 376, 323, 369, 317, 369);
if (currentCondiment == 2) {
fill(255, 245, 50);
rectMode(CENTER);
rect(mouseX, mouseY, 15, 30);
rect(mouseX, mouseY+17, 10, 4);
triangle(mouseX, mouseY+26, mouseX+3, mouseY+19, mouseX-3, mouseY +19);
}
}
//check if relish was applied
void relish() {
fill(50, 170, 50);
rectMode(CENTER);
rect(290, 350, 15, 30);
rect(290, 367, 10, 4);
triangle(290, 376, 293, 369, 287, 369);
if (currentCondiment == 3) {
fill(50, 170, 50);
rectMode(CENTER);
rect(mouseX, mouseY, 15, 30);
rect(mouseX, mouseY+17, 10, 4);
triangle(mouseX, mouseY+26, mouseX+3, mouseY+19, mouseX-3, mouseY +19);
}
}
//set which condiment is currently selected
void whichCondiment() {
if (mouseX > 343 && mouseX < 357 && mouseY > 335 && mouseY < 365) {
currentCondiment = 1;
}
if (mouseX > 313 && mouseX < 327 && mouseY > 335 && mouseY < 365) {
currentCondiment = 2;
}
if (mouseX > 283 && mouseX < 297 && mouseY > 335 && mouseY < 365) {
currentCondiment = 3;
}
}
// check if the player added the right condiment, and than sets the burger to ready
// this adds a top bun
void isBurgerReady() {
if (mouseX > b1location.x-30 && mouseX < b1location.x+30 && mouseY > 30 && mouseY < 90 && currentCondiment == neededCondiment1) {
Burger1IsReady = true;
}
if (mouseX > b2location.x-30 && mouseX < b2location.x+30 && mouseY > 100 && mouseY < 160 && currentCondiment == neededCondiment2) {
Burger2IsReady = true;
}
if (mouseX > b3location.x-30 && mouseX < b3location.x+30 && mouseY > 170 && mouseY < 230 && currentCondiment == neededCondiment3) {
Burger3IsReady = true;
}
if (mouseX > b4location.x-30 && mouseX < b4location.x+30 && mouseY > 240 && mouseY < 300 && currentCondiment == neededCondiment4) {
Burger4IsReady = true;
}
}
// check for every case scenario
void matchTheCondiment() {
if (neededCondimentRandomizer1 == 1) {
neededCondiment1 = 1;
fill(240, 20, 20);
rectMode(CORNERS);
rect(20, 85, 40, 105);
}
if (neededCondimentRandomizer1 == 2) {
neededCondiment1 = 2;
fill(255, 245, 50);
rectMode(CORNERS);
rect(20, 85, 40, 105);
}
if (neededCondimentRandomizer1 == 3) {
neededCondiment1 = 3;
fill(50, 170, 50);
rectMode(CORNERS);
rect(20, 85, 40, 105);
}
if (neededCondimentRandomizer2 == 1) {
neededCondiment2 = 1;
fill(240, 20, 20);
rectMode(CORNERS);
rect(20, 155, 40, 175);
}
if (neededCondimentRandomizer2 == 2) {
neededCondiment2 = 2;
fill(255, 245, 50);
rectMode(CORNERS);
rect(20, 155, 40, 175);
}
if (neededCondimentRandomizer2 == 3) {
neededCondiment2 = 3;
fill(50, 170, 50);
rectMode(CORNERS);
rect(20, 155, 40, 175);
}
if (neededCondimentRandomizer3 == 1) {
neededCondiment3 = 1;
fill(240, 20, 20);
rectMode(CORNERS);
rect(20, 225, 40, 245);
}
if (neededCondimentRandomizer3 == 2) {
neededCondiment3 = 2;
fill(255, 245, 50);
rectMode(CORNERS);
rect(20, 225, 40, 245);
}
if (neededCondimentRandomizer3 == 3) {
neededCondiment3 = 3;
fill(50, 170, 50);
rectMode(CORNERS);
rect(20, 225, 40, 245);
}
if (neededCondimentRandomizer4 == 1) {
neededCondiment4 = 1;
fill(240, 20, 20);
rectMode(CORNERS);
rect(20, 295, 40, 315);
}
if (neededCondimentRandomizer4 == 2) {
neededCondiment4 = 2;
fill(255, 245, 50);
rectMode(CORNERS);
rect(20, 295, 40, 315);
}
if (neededCondimentRandomizer4 == 3) {
neededCondiment4 = 3;
fill(50, 170, 50);
rectMode(CORNERS);
rect(20, 295, 40, 315);
}
}
}