Guest User

Untitled

a guest
Feb 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. //Fight Club
  2. //"Soap and human sacrifice go hand in hand."
  3. //Amy Pinilla
  4. //February 12th, 2018
  5.  
  6. color reddish = color (185, 26, 26);
  7. color pinkish = color (227, 50, 103);
  8. color silver = color (192, 192, 192);
  9. color bubble = color (136, 159, 203, 150);
  10. color magenta = color (214, 26, 104);
  11.  
  12. boolean theKey = false;
  13.  
  14. float z= 40;
  15.  
  16. float a=576;
  17. float b=357;
  18.  
  19. int soapColor=2;
  20.  
  21. float stroke = 0;
  22.  
  23. void setup () {
  24. println ("'Soap and human sacrifice go hand in hand.'");
  25. println ("Press the mouse and clear the static.");
  26. println ("Press any key. Change the color of the soap dish. Ruin this drawing.");
  27. println ( "Reach self destruction.");
  28. size (800, 800) ;
  29. stroke(255, 0, 0);
  30. frameRate(5);
  31. }
  32.  
  33. void draw () {
  34. if (mousePressed) {
  35. stroke = stroke +10;
  36. } else {
  37. stroke = stroke+1;
  38. }
  39. //clearing the static
  40.  
  41. for (int i = 0; i < width; i++) {
  42. float r = random(255);
  43. stroke(r);
  44. line(i, 0, i, height);
  45. strokeWeight (stroke);
  46. }//static background (creates lines randomly)
  47.  
  48. noStroke();
  49. fill (bubble);
  50. ellipse (mouseX, mouseY, 50, 50);
  51. //bubble
  52.  
  53. rectMode (CORNERS);
  54. fill (silver);
  55. noStroke();
  56. translate (width/11, height/-28);
  57. rotate (PI/32);
  58. rect (9, 159, 750, 662, 199);
  59. //soap dish
  60.  
  61. if (mouseX < width/3) {
  62. soapColor = 0;
  63. } else if (mouseX > width/3 && mouseX < width/3*2) {
  64. soapColor = 1;
  65. } else {
  66. soapColor = 2;
  67. }
  68.  
  69. if (keyPressed) {
  70. silver = silver -10;
  71. theKey=true;
  72. } else {
  73. silver = silver;
  74. theKey = false;
  75. }
  76. //press any key
  77.  
  78. if (soapColor ==0 | mouseX>=800) {
  79. noStroke();
  80. rectMode (CORNER);
  81. translate (width/11, height/-28);
  82. rotate (PI/-50);
  83. fill (pinkish);
  84. rect (-3, 275, a, b, 63);
  85. //soap bar pink
  86. } else if (soapColor==1) {
  87. noStroke();
  88. rectMode (CORNER);
  89. translate (width/11, height/-28);
  90. rotate (PI/-50);
  91. fill (reddish);
  92. rect (-3, 275, a, b, 63);
  93. //soap bar red
  94. } else {
  95. noStroke();
  96. rectMode (CORNER);
  97. translate (width/11, height/-28);
  98. rotate (PI/-50);
  99. fill (magenta);
  100. rect (-3, 275, a, b, 63);
  101. //soap bar
  102. }
  103. }
Add Comment
Please, Sign In to add comment