Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. void setup()
  2. {
  3.  
  4. size(900,900);
  5. background(0);
  6.  
  7. frameRate(3);
  8.  
  9. }
  10.  
  11.  
  12. void draw(){
  13. noStroke();
  14. background(#B5A0E5);
  15. fill (#FAFAFC);
  16. rect(300,400,20,355);
  17. rect(600,400,20,355);
  18. //to get 2 diffent objects to move randomly, make 2 variables of the same size n make it random
  19. float r = random(50,200);
  20. float r1= random(50,200);
  21.  
  22. if(mousePressed){
  23. fill(#F2181C);
  24. }else{
  25. fill(400,59,255);
  26. }
  27.  
  28. ellipse(310,380,r,r);
  29. fill(#6F66A5);
  30. if (mousePressed)
  31. { ellipse(mouseX,mouseY,r1,r1);
  32. } else
  33. {ellipse(610,380,r1,r1);
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement