Guest User

Untitled

a guest
Mar 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. float x = 25;
  2. float y = 50;
  3. float z = 75;
  4. float a = 100;
  5. float b = 125;
  6. float c = 150;
  7. float e = 175;
  8. float f = 200;
  9. float g = 225;
  10. float d = 0;
  11. boolean going = false;
  12. line line;
  13.  
  14. void setup() {
  15. fullScreen();
  16. //size(3000,3000);
  17. line = new line();
  18.  
  19.  
  20. }
  21.  
  22. void draw() {
  23.  
  24. noStroke();
  25. if ((mouseX > width/3) && (mouseY < height/3)) {
  26. background(100,200,255); //blue background
  27. } else if ((mouseX < width/3) && (mouseY > height/3)) {
  28. background(255,200,100);//yellow background
  29. } else if ((mouseX > width/3) && (mouseY > height/3)){
  30. background(100,255,200); //green background1
  31. } else if ((mouseX < width/3) && (mouseY < height/3)) {
  32. background(200,255,100);//green background2
  33. }
  34. if ((mouseX > width/3) && (mouseY < height/3)) {
  35. fill(255,200,100);
  36. ellipse(mouseX,mouseY,50,50);
  37. } else if ((mouseX < width/3) && (mouseY > height/3)) {
  38. fill(200,100,255);
  39. ellipse(mouseX,mouseY,50,50);
  40. } else if ((mouseX > width/3) && (mouseY > height/3)){
  41. fill(250,150,255);
  42. ellipse(mouseX,mouseY,50,50);
  43. }else if ((mouseX < width/3) && (mouseY < height/3)) {
  44. fill(200,255,250);
  45. ellipse(mouseX,mouseY,50,50);
  46. }
  47. stroke(255);
  48. if (d > width) {
  49. d= 0;
  50. }
  51. point(mouseX, mouseY);
  52. //height
  53. line(a, 0, d, height);
  54. line(b, 0, d, height);
  55. line(c, 0, d, height);
  56. line(x, 0, d, height);
  57. line(y, 0, d, height);
  58. line(z, 0, d, height);
  59. line(d, 0, z, height);
  60. line(d, 0, y, height);
  61. line(d, 0, x, height);
  62. line(d, 0, c, height);
  63. line(d, 0, b, height);
  64. line(d, 0, a, height);
  65. line(e, 0, d, height);
  66. line(d, 0, e, height);
  67. line(d, 0, f, height);
  68. line(f, 0, d, height);
  69. line(g, 0, d, height);
  70. line(d, 0, g, height);
  71. //widths
  72. line(0, a, width, d);
  73. line(0, d, width, a);
  74. line(0, b, width, d);
  75. line(0, d, width, b);
  76. line(0, c, width, d);
  77. line(0, d, width, c);
  78. line(0, e, width, d);
  79. line(0, d, width, e);
  80. line(0, f, width, d);
  81. line(0, d, width, f);
  82. line(0, g, width, d);
  83. line(0, d, width, g);
  84.  
  85. line.drawline();
  86. noStroke();
  87. fill(0);
  88. ellipse(x,100,100,100);
  89. ellipse(x,200,100,100);
  90. ellipse(x,300,100,100);
  91. ellipse(x,400,100,100);
  92. ellipse(x,500,100,100);
  93. ellipse(x,600,100,100);
  94. ellipse(x,700,100,100);
  95. ellipse(x,800,100,100);
  96. ellipse(x,900,100,100);
  97. ellipse(x,1000,100,100);
  98. ellipse(x,1100,100,100);
  99. ellipse(x,1200,100,100);
  100. ellipse(x,1300,100,100);
  101. ellipse(x,1400,100,100);
  102. ellipse(x,1500,100,100);
  103. ellipse(x,1600,100,100);
  104. ellipse(x,1700,100,100);
  105. ellipse(x,1800,100,100);
  106. ellipse(x,1900,100,100);
  107. ellipse(x,2000,100,100);
  108.  
  109. if (going) {
  110. if (x < width/2) {
  111. x = x + .5;
  112.  
  113. }
  114.  
  115. if (x < width) {
  116. d = d + 1; }
  117. fill(50);
  118. ellipse(y,100,100,100);
  119. ellipse(y,200,100,100);
  120. ellipse(y,300,100,100);
  121. ellipse(y,400,100,100);
  122. ellipse(y,500,100,100);
  123. ellipse(y,600,100,100);
  124. ellipse(y,700,100,100);
  125. ellipse(y,800,100,100);
  126. ellipse(y,900,100,100);
  127. ellipse(y,1000,100,100);
  128. ellipse(y,1100,100,100);
  129. ellipse(y,1200,100,100);
  130. ellipse(y,1300,100,100);
  131. ellipse(y,1400,100,100);
  132. ellipse(y,1500,100,100);
  133. ellipse(y,1600,100,100);
  134. ellipse(y,1700,100,100);
  135. ellipse(y,1800,100,100);
  136. ellipse(y,1900,100,100);
  137. ellipse(y,2000,100,100);
  138. if (going) {
  139. y = y + .6;
  140. }
  141. fill(100);
  142. ellipse(z,100,100,100);
  143. ellipse(z,200,100,100);
  144. ellipse(z,300,100,100);
  145. ellipse(z,400,100,100);
  146. ellipse(z,500,100,100);
  147. ellipse(z,600,100,100);
  148. ellipse(z,700,100,100);
  149. ellipse(z,800,100,100);
  150. ellipse(z,900,100,100);
  151. ellipse(z,1000,100,100);
  152. ellipse(z,1100,100,100);
  153. ellipse(z,1200,100,100);
  154. ellipse(z,1300,100,100);
  155. ellipse(z,1400,100,100);
  156. ellipse(z,1500,100,100);
  157. ellipse(z,1600,100,100);
  158. ellipse(z,1700,100,100);
  159. ellipse(z,1800,100,100);
  160. ellipse(z,1900,100,100);
  161. ellipse(z,2000,100,100);
  162. if (going) {
  163. z = z + .7;
  164. }
  165. fill(150);
  166. ellipse(a,100,100,100);
  167. ellipse(a,200,100,100);
  168. ellipse(a,300,100,100);
  169. ellipse(a,400,100,100);
  170. ellipse(a,500,100,100);
  171. ellipse(a,600,100,100);
  172. ellipse(a,700,100,100);
  173. ellipse(a,800,100,100);
  174. ellipse(a,900,100,100);
  175. ellipse(a,1000,100,100);
  176. ellipse(a,1100,100,100);
  177. ellipse(a,1200,100,100);
  178. ellipse(a,1300,100,100);
  179. ellipse(a,1400,100,100);
  180. ellipse(a,1500,100,100);
  181. ellipse(a,1600,100,100);
  182. ellipse(a,1700,100,100);
  183. ellipse(a,1800,100,100);
  184. ellipse(a,1900,100,100);
  185. ellipse(a,2000,100,100);
  186. if (going) {
  187. a = a + .8;
  188. }
  189. fill(200);
  190. ellipse(b,100,100,100);
  191. ellipse(b,200,100,100);
  192. ellipse(b,300,100,100);
  193. ellipse(b,400,100,100);
  194. ellipse(b,500,100,100);
  195. ellipse(b,600,100,100);
  196. ellipse(b,700,100,100);
  197. ellipse(b,800,100,100);
  198. ellipse(b,900,100,100);
  199. ellipse(b,1000,100,100);
  200. ellipse(b,1100,100,100);
  201. ellipse(b,1200,100,100);
  202. ellipse(b,1300,100,100);
  203. ellipse(b,1400,100,100);
  204. ellipse(b,1500,100,100);
  205. ellipse(b,1600,100,100);
  206. ellipse(b,1700,100,100);
  207. ellipse(b,1800,100,100);
  208. ellipse(b,1900,100,100);
  209. ellipse(b,2000,100,100);
  210. if (going) {
  211. b = b + .9;
  212. }
  213. fill(250);
  214. ellipse(c,100,100,100);
  215. ellipse(c,200,100,100);
  216. ellipse(c,300,100,100);
  217. ellipse(c,400,100,100);
  218. ellipse(c,500,100,100);
  219. ellipse(c,600,100,100);
  220. ellipse(c,700,100,100);
  221. ellipse(c,800,100,100);
  222. ellipse(c,900,100,100);
  223. ellipse(c,1000,100,100);
  224. ellipse(c,1100,100,100);
  225. ellipse(c,1200,100,100);
  226. ellipse(c,1300,100,100);
  227. ellipse(c,1400,100,100);
  228. ellipse(c,1500,100,100);
  229. ellipse(c,1600,100,100);
  230. ellipse(c,1700,100,100);
  231. ellipse(c,1800,100,100);
  232. ellipse(c,1900,100,100);
  233. ellipse(c,2000,100,100);
  234. if (going) {
  235. c = c + 1;
  236. }
  237. stroke(0);
  238. line(pmouseX, pmouseY, mouseX, mouseY); // draw the first line
  239. line(pmouseX-100, pmouseY-100, mouseX-100, mouseY-100);
  240. line(pmouseX+100, pmouseY+100, mouseX+100, mouseY+100);
  241. }
  242. }
  243.  
  244. void mousePressed() {
  245. if (going) {
  246. going = false;
  247. } else {
  248. going = true;
  249. }
  250.  
  251. }
Add Comment
Please, Sign In to add comment