Advertisement
sakureis

b&w

Apr 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. float x = 506;
  2. float y = 113;
  3. float speedX = 7;
  4. float speedY = 7;
  5. float circleSize = 10;
  6.  
  7. void setup(){
  8. size(800, 800);
  9. background(#80D7EA);
  10. }
  11.  
  12. void draw(){
  13. // Behavior
  14.  
  15. noFill();
  16. stroke(random(255));
  17. strokeWeight(random(7));
  18. x = x+speedX;
  19. y = y+speedY;
  20. circleSize = random(25, 16)/9;
  21.  
  22. // Drawing the ellipse
  23. ellipse(x,y,random(49),random(25));
  24.  
  25. //Reset the position
  26. x += speedX;
  27. if(x > width || x < 0){
  28. speedX *= -1;
  29. }
  30.  
  31. y += speedY;
  32. if(y > height || y < 0){
  33. speedY *= -1;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement