sakureis

Untitled

Apr 16th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. function 1/purple maze:
  2. // SETUP - Runs only Once
  3. void setup(){
  4. size(800,600);
  5. background(200); // 0-255
  6. background(179,233,255); // RED line
  7.  
  8.  
  9. }
  10. // DRAW - A loop! Will run forever!
  11. void draw(){
  12. // ( x, y, w, h)
  13. // ellipse( mouseX, mouseY, 13*10, 13*10);
  14.  
  15. }
  16.  
  17. void mouseDragged(){
  18. fill(#EADFFF);
  19. square( mouseX, mouseY, 49);
  20. }
  21.  
  22.  
  23. function2/doodle:
  24. // SETUP - Runs only Once
  25. void setup(){
  26. size(800,600);
  27. background(200); // 0-255
  28. background(#D2FFEB); // RED line
  29.  
  30.  
  31. }
  32. // DRAW - A loop! Will run forever!
  33. void draw(){
  34. // ( x, y, w, h)
  35. // ellipse( mouseX, mouseY, 13*10, 13*10);
  36.  
  37. }
  38.  
  39. void mouseDragged(){
  40. ellipse( mouseX, mouseY, 1, 1);
  41. }
  42.  
  43.  
  44. function3/screenshot/attempted animation:
  45. void mouseMoved() {
  46. fill(#FFD7D7);
  47. square( mouseX, mouseY, 49);
  48. }
  49.  
  50. PImage lol;
  51.  
  52. void setup() {
  53. size(1390, 1366);
  54. lol = loadImage("lol.jpg");
  55. }
  56.  
  57. void draw() {
  58. background(0);
  59. image(lol, 0, 0);
  60. }
  61.  
  62.  
  63. hw2/animation test:
  64. float x = 100;
  65. float y = 200;
  66. float speedX = 2;
  67. float speedY = 0.5;
  68. float circleSize = 5;
  69.  
  70. void setup(){
  71. size(500, 500);
  72. background(#BDDCFF);
  73. }
  74.  
  75. void draw(){
  76. // Behavior
  77.  
  78. fill(random(#B7FFC1),random(255),random(193));
  79. x = x+speedX;
  80. y = y+speedY;
  81. circleSize = random(10, 45)/10;
  82.  
  83. // Drawing the ellipse
  84. ellipse(x, y, 35, 35);
  85.  
  86. //Reset the position
  87. x += speedX;
  88. if(x > width || x < 0){
  89. speedX *= -1;
  90. }
  91.  
  92. y += speedY;
  93. if(y > height || y < 0){
  94. speedY *= -1;
  95. }
  96. }
  97.  
  98.  
  99. hw2/animation:
  100. float x = 100;
  101. float y = 200;
  102. float speedX = 2;
  103. float speedY = 3;
  104. float circleSize = 5;
  105.  
  106. void setup(){
  107. size(500, 500);
  108. background(#BDDCFF);
  109. }
  110.  
  111. void draw(){
  112. // Behavior
  113.  
  114. fill(random(255),random(255),random(193));
  115. x = x+speedX;
  116. y = y+speedY;
  117.  
  118. // Drawing the ellipse
  119. ellipse(x, y, 100, 100);
  120.  
  121. //Reset the position
  122. x += speedX;
  123. if(x > width || x < 0){
  124. speedX *= -1;
  125. }
  126.  
  127. y += speedY;
  128. if(y > height || y < 0){
  129. speedY *= -1;
  130. }
  131. }
Add Comment
Please, Sign In to add comment