Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float dia = 40;
- float x = dia/2;
- float y = -dia;
- void setup(){
- size(400,300);
- background(255);
- }
- void draw()
- {
- background(255);
- ellipse(x,y,dia,dia);
- x = x + 1; //at the end of each iteration of draw, x increases by 1
- }
- void mousePressed()
- {
- x = mouseX;
- y= mouseY; // x and y now hold the location where the mouse is pressed, thereby drawing the next circle at the location
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement