Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bubble{
- int x, y, d;
- color c;
- Bubble(){
- x = (int)(Math.random() * width/2);
- y = height;
- c = (int)(Math.random() * 256);
- d = (int)(Math.random() * 40 + 5);
- }
- void ascend(){
- y--;
- x += (int)(Math.random() * 10 - 5);
- }
- void display(){
- fill(c);
- ellipse(x, y, d, d);
- }
- }
Add Comment
Please, Sign In to add comment