Advertisement
joe_891

Untitled

Oct 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. float dia = 40;
  2. float x = dia/2;
  3. float y = -dia;
  4. void setup(){
  5. size(400,300);
  6. background(255);
  7. }
  8. void draw()
  9. {
  10. background(255);
  11. ellipse(x,y,dia,dia);
  12. x = x + 1; //at the end of each iteration of draw, x increases by 1
  13. }
  14. void mousePressed()
  15. {
  16. x = mouseX;
  17. y= mouseY; // x and y now hold the location where the mouse is pressed, thereby drawing the next circle at the location
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement