Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x, y, z;
- boolean screen;
- void settings() {
- size(600, 600);
- }
- void setup() {
- colorMode(HSB, 255);
- x = 48;
- y = 252;
- z = 39;
- }
- void draw() {
- background(255);
- if (mouseButton == LEFT) {
- screen = false;
- } else if (mouseButton == RIGHT) {
- screen = true;
- }
- if (screen == false) {
- screenOne();
- } else if (screen == true) {
- screenTwo();
- }
- }
- void screenOne() {
- stroke(0);
- fill(0);
- //Stove
- ellipse(width/2, height*1/4, 165, 165);
- for (float i = 150; i > 0; i -= 12) {
- fill(7, 252, 216);
- ellipse (width/2, height*1/4, i, i);
- }
- //Pan
- fill(150);
- rect(width/2 + 47, height*1/4 -7, 80, 14, 0, 30, 30, 0);
- ellipse(width/2, height*1/4, 100, 100);
- //Pancake
- fill(33, 150, 222);
- ellipse(width/2, height*1/4, 70, 70);
- //Title
- fill(0);
- textSize(27);
- text("Cooking Pancake Simulator 1.0", width*1/6, height*1/15);
- //Side view pan
- fill(150);
- rect(width/2 + 149, height*3/4 + 5, 80, 7, 0, 30, 30, 0);
- rect(width/2, height*3/4, 150, 20, 0, 0, 30, 30);
- noStroke();
- rect(width*3/4 - 4, height*3/4 + 7, 5, 5);
- //PANCAKE SIDE
- stroke(0);
- rect(width/2+ 19, height*3/4-16, 101, 15);
- noStroke();
- fill(z, x, y); //Bottom
- rect(width/2+ 20, height*3/4-8, 100, 7);
- fill(39, 48, 252); //Top
- rect(width/2+ 20, height*3/4-15, 100, 7);
- if (x >= 255 && y >= 255){
- x = 150;
- y = 222;
- z = 33;
- }
- }
- void keyPressed() {//Pancake colour
- if (key == 'x' && z == 39)
- x += 4;
- y += 2;
- }
- void screenTwo() {
- background(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement