Guest User

Untitled

a guest
Oct 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. function setup() {
  2. createCanvas(5000,5000);
  3. background(0,0,0);
  4. angleMode(DEGREES);
  5.  
  6. let headFunctions = [brownhead, peachhead, yellowhead];
  7.  
  8. let mouthFunctions = [smilingmouth, vampiremouth, squirrelmouth, bracesmouth, sadmouth, ehmouth, viciousmouth];
  9.  
  10. let eyesFunctions = [normaleyes, rollingeyes, lookingrighteyes, sleepingeyes];
  11.  
  12. let addonsFunctions = [crying, hat, babyhair, sunglasses, unicornhorn, redstriphat, whitestriphat];
  13.  
  14. for (var row = 0; row <= 32; row++) {
  15. push();
  16. for (var col = 0; col <= 300; col++) {
  17. let randomHead = headFunctions[int(random(0, headFunctions.length))];
  18. randomHead();
  19. let randomEyes = eyesFunctions[int(random(0, eyesFunctions.length))];
  20. randomEyes();
  21. let randomMouth = mouthFunctions[int(random(0, mouthFunctions.length))];
  22. randomMouth();
  23. let randomAddons = addonsFunctions[int(random(0, addonsFunctions.length))];
  24. randomAddons();
  25. translate(200, 0);
  26. }
  27. pop();
  28. translate(0, 150);
  29. }
  30. }
  31.  
  32.  
  33. function smilingmouth(){
  34. stroke(255,255,255)
  35. fill(255,255,255);
  36. arc(100,110,70,70,0,180,PIE);}
  37.  
  38. function squirrelmouth(){
  39. stroke(0,0,0)
  40. line(70,113,127,113)
  41. fill(255,255,255)
  42. stroke(255,255,255)
  43. rect(77,114,20,40)
  44. rect(102,114,20,40)}
  45.  
  46. function vampiremouth(){
  47. stroke(0,0,0)
  48. line(70,113,127,113)
  49. fill(255,255,255)
  50. stroke(255,255,255)
  51. triangle(77,115,90,115,83,160)
  52. triangle(107,115,120,115,113,160)}
  53.  
  54. function ehmouth(){
  55. line(70,120,127,120)}
  56.  
  57. function sadmouth(){
  58. stroke(255,255,255)
  59. fill(255,255,255)
  60. arc(100,130,50,40,180,0,PIE);}
  61.  
  62. function bracesmouth(){
  63. stroke(0,0,0)
  64. fill(0,0,0)
  65. rect(68,110,60,20)
  66. stroke(255,255,255)
  67. fill(255,255,255)
  68. rect(68,110,10,10)
  69. rect(78,110,10,10)
  70. rect(88,110,10,10)
  71. rect(98,110,10,10)
  72. rect(108,110,10,10)
  73. rect(118,110,10,10)
  74. stroke(255,0,0)
  75. fill(255,0,0)
  76. rect(70,112,5,5)
  77. rect(80,112,5,5)
  78. rect(90,112,5,5)
  79. rect(100,112,5,5)
  80. rect(110,112,5,5)
  81. rect(120,112,5,5)
  82. stroke(0,0,0)
  83. line(73,110,73,120)
  84. line(83,110,83,120)
  85. line(93,110,93,120)
  86. line(103,110,103,120)
  87. line(113,110,113,120)
  88. line(123,110,123,120)
  89. line(68,115,128,115)}
  90.  
  91. function viciousmouth(){
  92. stroke(0,0,0)
  93. fill(0,0,0)
  94. rect(74,110,48,20)
  95. stroke(255,255,255)
  96. fill(255,255,255)
  97. triangle(69,110,79,110,74,130)
  98. rect(78,109.5,10,10)
  99. rect(88,109.5,10,10)
  100. rect(98,109.5,10,10)
  101. rect(108,109.5,10,10)
  102. triangle(118,110,128,110,123,130)}
  103.  
  104.  
  105.  
  106. function yellowhead(){
  107. stroke(244,225,66)
  108. fill(244,226,66);
  109. ellipse(100,100,100,100);}
  110.  
  111. function brownhead(){
  112. stroke(71,44,44)
  113. fill(71,44,44);
  114. ellipse(100,100,100,100);}
  115.  
  116. function peachhead(){
  117. stroke(255,194,124)
  118. fill(255,194,124);
  119. ellipse(100,100,100,100);}
  120.  
  121.  
  122.  
  123. function normaleyes(){
  124. fill(255,255,255);
  125. ellipse(80,85,20,20);
  126. ellipse(117,85,20,20);}
  127.  
  128. function rollingeyes(){
  129. stroke(255,255,255)
  130. fill(255,255,255)
  131. ellipse(80,85,30,30);
  132. ellipse(117,85,30,30);
  133. fill(0,0,0)
  134. fill(0,0,0);
  135. ellipse(83,78,15,15);
  136. ellipse(118,78,15,15);}
  137.  
  138. function lookingrighteyes(){
  139. stroke(255,255,255)
  140. fill(255,255,255)
  141. ellipse(80,85,30,40);
  142. ellipse(117,85,30,40);
  143. stroke(0,0,0)
  144. fill(0,0,0);
  145. ellipse(88,83,15,15);
  146. ellipse(125,83,15,15);}
  147.  
  148. function sleepingeyes(){
  149. noFill();
  150. stroke(255,255,255);
  151. curve(120, 75, 110, 85, 130, 85, 120, 75);
  152. curve(77, 75, 67, 85, 87, 85, 77, 75);}
  153.  
  154.  
  155.  
  156. function crying(){
  157. fill(66,167,244);
  158. stroke(66,167,244);
  159. bezier(127, 91, 143, 165, 200, 95, 127, 91);
  160. bezier(70, 92, 2, 102, 63, 171, 71, 91);}
  161.  
  162. function hat(){
  163. stroke(96,35,35)
  164. fill(96,35,35)
  165. rect(49,50,100,10)
  166. rect(64,20,70,30)
  167. fill(66,63,63)
  168. stroke(66,63,63)
  169. rect(64,30,70,10)}
  170.  
  171. function redstriphat(){
  172. stroke(96,35,35)
  173. fill(96,35,35)
  174. rect(49,50,100,10)
  175. rect(64,20,70,30)
  176. fill(206,78,78)
  177. stroke(206,78,78)
  178. rect(64,30,70,10)}
  179.  
  180. function whitestriphat(){
  181. stroke(96,35,35)
  182. fill(96,35,35)
  183. rect(49,50,100,10)
  184. rect(64,20,70,30)
  185. fill(255,255,255)
  186. stroke(255,255,255)
  187. rect(64,30,70,10)}
  188.  
  189. function babyhair(){
  190. noFill();
  191. stroke(255,255,255);
  192. bezier(80, 32, 141, 52, 93, 0, 98, 52);}
  193.  
  194. function sunglasses(){
  195. stroke(0,0,0)
  196. fill(0,0,0)
  197. rect(101,80,40,15)
  198. rect(55,80,40,15)
  199. stroke(0,0,0)
  200. line(95,90,100,90)}
  201.  
  202. function unicornhorn(){
  203. stroke(255,86,221)
  204. fill(255,86,221)
  205. triangle(98,20,108,60,88,60)
  206. stroke(255,163,236)
  207. fill(255,163,236)
  208. triangle(98,20,103,40,93,40)
  209. stroke(255,255,255)
  210. fill(255,255,255)
  211. triangle(98,20,96,30,100,30)}
Add Comment
Please, Sign In to add comment