Advertisement
Guest User

1

a guest
Apr 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. float x, y, z;
  2. boolean screen;
  3. void settings() {
  4. size(600, 600);
  5. }
  6.  
  7. void setup() {
  8. colorMode(HSB, 255);
  9. x = 48;
  10. y = 252;
  11. z = 39;
  12. }
  13.  
  14. void draw() {
  15. background(255);
  16. if (mouseButton == LEFT) {
  17. screen = false;
  18. } else if (mouseButton == RIGHT) {
  19. screen = true;
  20. }
  21. if (screen == false) {
  22. screenOne();
  23. } else if (screen == true) {
  24. screenTwo();
  25. }
  26. }
  27. void screenOne() {
  28. stroke(0);
  29. fill(0);
  30. //Stove
  31. ellipse(width/2, height*1/4, 165, 165);
  32. for (float i = 150; i > 0; i -= 12) {
  33. fill(7, 252, 216);
  34. ellipse (width/2, height*1/4, i, i);
  35. }
  36. //Pan
  37. fill(150);
  38. rect(width/2 + 47, height*1/4 -7, 80, 14, 0, 30, 30, 0);
  39. ellipse(width/2, height*1/4, 100, 100);
  40. //Pancake
  41. fill(33, 150, 222);
  42. ellipse(width/2, height*1/4, 70, 70);
  43. //Title
  44. fill(0);
  45. textSize(27);
  46. text("Cooking Pancake Simulator 1.0", width*1/6, height*1/15);
  47. //Side view pan
  48. fill(150);
  49. rect(width/2 + 149, height*3/4 + 5, 80, 7, 0, 30, 30, 0);
  50. rect(width/2, height*3/4, 150, 20, 0, 0, 30, 30);
  51. noStroke();
  52. rect(width*3/4 - 4, height*3/4 + 7, 5, 5);
  53. //PANCAKE SIDE
  54. stroke(0);
  55. rect(width/2+ 19, height*3/4-16, 101, 15);
  56. noStroke();
  57. fill(z, x, y); //Bottom
  58. rect(width/2+ 20, height*3/4-8, 100, 7);
  59. fill(39, 48, 252); //Top
  60. rect(width/2+ 20, height*3/4-15, 100, 7);
  61. if (x >= 255 && y >= 255){
  62. x = 150;
  63. y = 222;
  64. z = 33;
  65. }
  66.  
  67.  
  68. }
  69. void keyPressed() {//Pancake colour
  70. if (key == 'x' && z == 39)
  71. x += 4;
  72. y += 2;
  73. }
  74.  
  75.  
  76.  
  77. void screenTwo() {
  78. background(0);
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement