Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x = 506;
- float y = 113;
- float speedX = 7;
- float speedY = 7;
- float circleSize = 10;
- void setup(){
- size(800, 800);
- background(#80D7EA);
- }
- void draw(){
- // Behavior
- noFill();
- stroke(random(255));
- strokeWeight(random(7));
- x = x+speedX;
- y = y+speedY;
- circleSize = random(25, 16)/9;
- // Drawing the ellipse
- ellipse(x,y,random(49),random(25));
- //Reset the position
- x += speedX;
- if(x > width || x < 0){
- speedX *= -1;
- }
- y += speedY;
- if(y > height || y < 0){
- speedY *= -1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement