Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.17 KB | None | 0 0
  1. int k1 = 0;
  2. PFont font;
  3.  
  4. PShape mushroom1;
  5. PShape mushroom2;
  6. PShape mushroom3;
  7. PShape mushroom4;
  8. PShape mushroom5;
  9. PShape mushroom6;
  10. PShape mushroom7;
  11. PShape mushroom8;
  12. PShape mushroom9;
  13. PShape mushroom10;
  14.  
  15. PShape cheese1;
  16. PShape cheese2;
  17. PShape cheese3;
  18. PShape cheese4;
  19. PShape cheese5;
  20. PShape cheese6;
  21. PShape cheese7;
  22. PShape cheese8;
  23. PShape cheese9;
  24. PShape cheese10;
  25. PShape cheese11;
  26. PShape cheese12;
  27. PShape cheese13;
  28. PShape cheese14;
  29. PShape cheese15;
  30. PShape cheese16;
  31. PShape cheese17;
  32. PShape cheese18;
  33. PShape cheese19;
  34. PShape cheese20;
  35. PShape cheese21;
  36. PShape cheese22;
  37. PShape cheese23;
  38. PShape cheese24;
  39. PShape cheese25;
  40. PShape cheese26;
  41. PShape cheese27;
  42. PShape cheese28;
  43. PShape cheese29;
  44. PShape cheese30;
  45.  
  46. //pepperoni locations
  47. int p1;
  48. int p2;
  49. int p3;
  50. int p4;
  51. int p5;
  52. int p6;
  53. int p7;
  54. int p8;
  55. int p9;
  56. int p10;
  57. int p11;
  58. int p12;
  59. int p13;
  60. int p14;
  61. int p15;
  62. int p16;
  63. int p17;
  64. int p18;
  65. int p19;
  66. int p20;
  67.  
  68. //cheese locations
  69. int c1;
  70. int c2;
  71. int c3;
  72. int c4;
  73. int c5;
  74. int c6;
  75. int c7;
  76. int c8;
  77. int c9;
  78. int c10;
  79. int c11;
  80. int c12;
  81. int c13;
  82. int c14;
  83. int c15;
  84. int c16;
  85. int c17;
  86. int c18;
  87. int c19;
  88. int c20;
  89. int c21;
  90. int c22;
  91. int c23;
  92. int c24;
  93. int c25;
  94. int c26;
  95. int c27;
  96. int c28;
  97. int c29;
  98. int c30;
  99. int c31;
  100. int c32;
  101. int c33;
  102. int c34;
  103. int c35;
  104. int c36;
  105. int c37;
  106. int c38;
  107. int c39;
  108. int c40;
  109. int c41;
  110. int c42;
  111. int c43;
  112. int c44;
  113. int c45;
  114. int c46;
  115. int c47;
  116. int c48;
  117. int c49;
  118. int c50;
  119. int c51;
  120. int c52;
  121. int c53;
  122. int c54;
  123. int c55;
  124. int c56;
  125. int c57;
  126. int c58;
  127. int c59;
  128. int c60;
  129.  
  130. //mushroom locations
  131. int m1;
  132. int m2;
  133. int m3;
  134. int m4;
  135. int m5;
  136. int m6;
  137. int m7;
  138. int m8;
  139. int m9;
  140. int m10;
  141. int m11;
  142. int m12;
  143. int m13;
  144. int m14;
  145. int m15;
  146. int m16;
  147. int m17;
  148. int m18;
  149. int m19;
  150. int m20;
  151.  
  152. void setup() {
  153.  
  154. size(500, 700);
  155. frameRate(30);
  156.  
  157. colorMode(HSB, 360, 100, 100);
  158.  
  159. font = createFont("SourceCodePro-Regular.ttf", 9);
  160.  
  161. mushroom1 = loadShape("mushroom.svg");
  162. mushroom2 = loadShape("mushroom.svg");
  163. mushroom3 = loadShape("mushroom.svg");
  164. mushroom4 = loadShape("mushroom.svg");
  165. mushroom5 = loadShape("mushroom.svg");
  166. mushroom6 = loadShape("mushroom.svg");
  167. mushroom7 = loadShape("mushroom.svg");
  168. mushroom8 = loadShape("mushroom.svg");
  169. mushroom9 = loadShape("mushroom.svg");
  170. mushroom10 = loadShape("mushroom.svg");
  171.  
  172. cheese1 = loadShape("cheese.svg");
  173. cheese2 = loadShape("cheese.svg");
  174. cheese3 = loadShape("cheese.svg");
  175. cheese4 = loadShape("cheese.svg");
  176. cheese5 = loadShape("cheese.svg");
  177. cheese6 = loadShape("cheese.svg");
  178. cheese7 = loadShape("cheese.svg");
  179. cheese8 = loadShape("cheese.svg");
  180. cheese9 = loadShape("cheese.svg");
  181. cheese10 = loadShape("cheese.svg");
  182. cheese11 = loadShape("cheese.svg");
  183. cheese12 = loadShape("cheese.svg");
  184. cheese13 = loadShape("cheese.svg");
  185. cheese14 = loadShape("cheese.svg");
  186. cheese15 = loadShape("cheese.svg");
  187. cheese16 = loadShape("cheese.svg");
  188. cheese17 = loadShape("cheese.svg");
  189. cheese18 = loadShape("cheese.svg");
  190. cheese19 = loadShape("cheese.svg");
  191. cheese20 = loadShape("cheese.svg");
  192. cheese21 = loadShape("cheese.svg");
  193. cheese22 = loadShape("cheese.svg");
  194. cheese23 = loadShape("cheese.svg");
  195. cheese24 = loadShape("cheese.svg");
  196. cheese25 = loadShape("cheese.svg");
  197. cheese26 = loadShape("cheese.svg");
  198. cheese27 = loadShape("cheese.svg");
  199. cheese28 = loadShape("cheese.svg");
  200. cheese29 = loadShape("cheese.svg");
  201. cheese30 = loadShape("cheese.svg");
  202. }
  203.  
  204.  
  205. void draw() {
  206. // note that for a pure white, a value of 360 is required in HSB (vs the 255 needed with the default)
  207. background(k1, 100, 100);
  208. noStroke();
  209. blendMode(BLEND);
  210.  
  211. smooth();
  212.  
  213.  
  214. //cheese
  215. noStroke();
  216. cheese1.disableStyle();
  217. cheese2.disableStyle();
  218. cheese3.disableStyle();
  219. cheese4.disableStyle();
  220. cheese5.disableStyle();
  221. cheese6.disableStyle();
  222. cheese7.disableStyle();
  223. cheese8.disableStyle();
  224. cheese9.disableStyle();
  225. cheese10.disableStyle();
  226. cheese11.disableStyle();
  227. cheese12.disableStyle();
  228. cheese13.disableStyle();
  229. cheese14.disableStyle();
  230. cheese15.disableStyle();
  231. cheese16.disableStyle();
  232. cheese17.disableStyle();
  233. cheese18.disableStyle();
  234. cheese19.disableStyle();
  235. cheese20.disableStyle();
  236. cheese21.disableStyle();
  237. cheese22.disableStyle();
  238. cheese23.disableStyle();
  239. cheese24.disableStyle();
  240. cheese25.disableStyle();
  241. cheese26.disableStyle();
  242. cheese27.disableStyle();
  243. cheese28.disableStyle();
  244. cheese29.disableStyle();
  245. cheese30.disableStyle();
  246. fill((k1+180)%360, 100, 100);
  247. shape(cheese1, c1, c2, 60, 55);
  248. shape(cheese2, c3, c4, 60, 55);
  249. shape(cheese3, c5, c6, 60, 55);
  250. shape(cheese4, c7, c8, 60, 55);
  251. shape(cheese5, c9, c10, 60, 55);
  252. shape(cheese6, c11, c12, 60, 55);
  253. shape(cheese7, c13, c14, 60, 55);
  254. shape(cheese8, c15, c16, 60, 55);
  255. shape(cheese9, c17, c18, 60, 55);
  256. shape(cheese10, c19, c20, 60, 55);
  257. shape(cheese11, c21, c22, 60, 55);
  258. shape(cheese12, c23, c24, 60, 55);
  259. shape(cheese13, c25, c26, 60, 55);
  260. shape(cheese14, c27, c28, 60, 55);
  261. shape(cheese15, c29, c30, 60, 55);
  262. shape(cheese16, c31, c32, 60, 55);
  263. shape(cheese17, c33, c34, 60, 55);
  264. shape(cheese18, c35, c36, 60, 55);
  265. shape(cheese19, c37, c38, 60, 55);
  266. shape(cheese20, c39, c40, 60, 55);
  267. shape(cheese21, c41, c42, 60, 55);
  268. shape(cheese22, c43, c44, 60, 55);
  269. shape(cheese23, c45, c46, 60, 55);
  270. shape(cheese24, c47, c48, 60, 55);
  271. shape(cheese25, c49, c50, 60, 55);
  272. shape(cheese26, c51, c52, 60, 55);
  273. shape(cheese27, c53, c54, 60, 55);
  274. shape(cheese28, c55, c56, 60, 55);
  275. shape(cheese29, c57, c58, 60, 55);
  276. shape(cheese30, c59, c60, 60, 55);
  277.  
  278.  
  279. //pepperoni
  280. fill(k1+270, 100, 100);
  281. ellipse(p1, p2, 60, 60);
  282. ellipse(p3, p4, 60, 60);
  283. ellipse(p5, p6, 60, 60);
  284. ellipse(p7, p8, 60, 60);
  285. ellipse(p9, p10, 60, 60);
  286. ellipse(p11, p12, 60, 60);
  287. ellipse(p13, p14, 60, 60);
  288. ellipse(p15, p16, 60, 60);
  289. ellipse(p17, p18, 60, 60);
  290. ellipse(p19, p20, 60, 60);
  291.  
  292. //mushroom
  293. noStroke();
  294. mushroom1.disableStyle();
  295. mushroom2.disableStyle();
  296. mushroom3.disableStyle();
  297. mushroom4.disableStyle();
  298. mushroom5.disableStyle();
  299. mushroom6.disableStyle();
  300. mushroom7.disableStyle();
  301. mushroom8.disableStyle();
  302. mushroom9.disableStyle();
  303. mushroom10.disableStyle();
  304. fill((k1+90)%360, 100, 100);
  305. shape(mushroom1, m1, m2, 60, 55);
  306. shape(mushroom2, m3, m4, 60, 55);
  307. shape(mushroom3, m5, m6, 60, 55);
  308. shape(mushroom4, m7, m8, 60, 55);
  309. shape(mushroom5, m9, m10, 60, 55);
  310. shape(mushroom6, m11, m12, 60, 55);
  311. shape(mushroom7, m13, m14, 60, 55);
  312. shape(mushroom8, m15, m16, 60, 55);
  313. shape(mushroom9, m17, m18, 60, 55);
  314. shape(mushroom10, m19, m20, 60, 55);
  315.  
  316.  
  317. // randomly selects a color around the 360 degree HSB wheel
  318. if (mousePressed) {
  319. k1 = int(random(0, 360));
  320.  
  321. p1 = int(random(50, 450));
  322. p2 = int(random(150, 550));
  323. p3 = int(random(50, 450));
  324. p4 = int(random(150, 550));
  325. p5 = int(random(50, 450));
  326. p6 = int(random(150, 550));
  327. p7 = int(random(50, 450));
  328. p8 = int(random(150, 550));
  329. p9 = int(random(50, 450));
  330. p10 = int(random(150, 550));
  331. p11 = int(random(50, 450));
  332. p12 = int(random(150, 550));
  333. p13 = int(random(50, 450));
  334. p14 = int(random(150, 550));
  335. p15 = int(random(50, 450));
  336. p16 = int(random(150, 550));
  337. p17 = int(random(50, 450));
  338. p18 = int(random(150, 550));
  339. p19 = int(random(50, 450));
  340. p20 = int(random(150, 550));
  341.  
  342. m1 = int(random(50, 450));
  343. m2 = int(random(150, 550));
  344. m3 = int(random(50, 450));
  345. m4 = int(random(150, 550));
  346. m5 = int(random(50, 450));
  347. m6 = int(random(150, 550));
  348. m7 = int(random(50, 450));
  349. m8 = int(random(150, 550));
  350. m9 = int(random(50, 450));
  351. m10 = int(random(150, 550));
  352. m11 = int(random(50, 450));
  353. m12 = int(random(150, 550));
  354. m13 = int(random(50, 450));
  355. m14 = int(random(150, 550));
  356. m15 = int(random(50, 450));
  357. m16 = int(random(150, 550));
  358. m17 = int(random(50, 450));
  359. m18 = int(random(150, 550));
  360. m19 = int(random(50, 450));
  361. m20 = int(random(150, 550));
  362.  
  363. c1 = int(random(50, 450));
  364. c2 = int(random(150, 550));
  365. c3 = int(random(50, 450));
  366. c4 = int(random(150, 550));
  367. c5 = int(random(50, 450));
  368. c6 = int(random(150, 550));
  369. c7 = int(random(50, 450));
  370. c8 = int(random(150, 550));
  371. c9 = int(random(50, 450));
  372. c10 = int(random(150, 550));
  373. c11 = int(random(50, 450));
  374. c12 = int(random(150, 550));
  375. c13 = int(random(50, 450));
  376. c14 = int(random(150, 550));
  377. c15 = int(random(50, 450));
  378. c16 = int(random(150, 550));
  379. c17 = int(random(50, 450));
  380. c18 = int(random(150, 550));
  381. c19 = int(random(50, 450));
  382. c20 = int(random(150, 550));
  383. c21 = int(random(50, 450));
  384. c22 = int(random(150, 550));
  385. c23 = int(random(50, 450));
  386. c24 = int(random(150, 550));
  387. c25 = int(random(50, 450));
  388. c26 = int(random(150, 550));
  389. c27 = int(random(50, 450));
  390. c28 = int(random(150, 550));
  391. c29 = int(random(50, 450));
  392. c30 = int(random(150, 550));
  393. c31 = int(random(50, 450));
  394. c32 = int(random(150, 550));
  395. c33 = int(random(50, 450));
  396. c34 = int(random(150, 550));
  397. c35 = int(random(50, 450));
  398. c36 = int(random(150, 550));
  399. c37 = int(random(50, 450));
  400. c38 = int(random(150, 550));
  401. c39 = int(random(50, 450));
  402. c40 = int(random(150, 550));
  403. c41 = int(random(50, 450));
  404. c42 = int(random(150, 550));
  405. c43 = int(random(50, 450));
  406. c44 = int(random(150, 550));
  407. c45 = int(random(50, 450));
  408. c46 = int(random(150, 550));
  409. c47 = int(random(50, 450));
  410. c48 = int(random(150, 550));
  411. c49 = int(random(50, 450));
  412. c50 = int(random(150, 550));
  413. c51 = int(random(50, 450));
  414. c52 = int(random(150, 550));
  415. c53 = int(random(50, 450));
  416. c54 = int(random(150, 550));
  417. c55 = int(random(50, 450));
  418. c56 = int(random(150, 550));
  419. c57 = int(random(50, 450));
  420. c58 = int(random(150, 550));
  421. c59 = int(random(50, 450));
  422. c60 = int(random(150, 550));
  423.  
  424. mushroom1.rotate(random(radians(0), radians(360)));
  425. mushroom2.rotate(random(radians(0), radians(360)));
  426. mushroom3.rotate(random(radians(0), radians(360)));
  427. mushroom4.rotate(random(radians(0), radians(360)));
  428. mushroom5.rotate(random(radians(0), radians(360)));
  429. mushroom6.rotate(random(radians(0), radians(360)));
  430. mushroom7.rotate(random(radians(0), radians(360)));
  431. mushroom8.rotate(random(radians(0), radians(360)));
  432. mushroom9.rotate(random(radians(0), radians(360)));
  433. mushroom10.rotate(random(radians(0), radians(360)));
  434.  
  435. cheese1.rotate(random(radians(0), radians(360)));
  436. cheese2.rotate(random(radians(0), radians(360)));
  437. cheese3.rotate(random(radians(0), radians(360)));
  438. cheese4.rotate(random(radians(0), radians(360)));
  439. cheese5.rotate(random(radians(0), radians(360)));
  440. cheese6.rotate(random(radians(0), radians(360)));
  441. cheese7.rotate(random(radians(0), radians(360)));
  442. cheese8.rotate(random(radians(0), radians(360)));
  443. cheese9.rotate(random(radians(0), radians(360)));
  444. cheese10.rotate(random(radians(0), radians(360)));
  445. cheese11.rotate(random(radians(0), radians(360)));
  446. cheese12.rotate(random(radians(0), radians(360)));
  447. cheese13.rotate(random(radians(0), radians(360)));
  448. cheese14.rotate(random(radians(0), radians(360)));
  449. cheese15.rotate(random(radians(0), radians(360)));
  450. cheese16.rotate(random(radians(0), radians(360)));
  451. cheese17.rotate(random(radians(0), radians(360)));
  452. cheese18.rotate(random(radians(0), radians(360)));
  453. cheese19.rotate(random(radians(0), radians(360)));
  454. cheese20.rotate(random(radians(0), radians(360)));
  455. cheese21.rotate(random(radians(0), radians(360)));
  456. cheese22.rotate(random(radians(0), radians(360)));
  457. cheese23.rotate(random(radians(0), radians(360)));
  458. cheese24.rotate(random(radians(0), radians(360)));
  459. cheese25.rotate(random(radians(0), radians(360)));
  460. cheese26.rotate(random(radians(0), radians(360)));
  461. cheese27.rotate(random(radians(0), radians(360)));
  462. cheese28.rotate(random(radians(0), radians(360)));
  463. cheese29.rotate(random(radians(0), radians(360)));
  464. cheese30.rotate(random(radians(0), radians(360)));
  465. }
  466.  
  467. noFill();
  468. stroke(0);
  469. strokeWeight(380);
  470. ellipse(width/2,350,800,800);
  471.  
  472. textFont(font);
  473. textAlign(LEFT);
  474. fill(360);
  475. text( "void pizza (party) {\n date (mar, 6, 2016);\n time (12 - 1);\n location (br, 320);\n}", 30, 40);
  476.  
  477. if (keyPressed==true) {
  478. saveFrame("johnson0_charette03_###.png");
  479. }
  480. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement