Guest User

Untitled

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