Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ball[] Balls = new Ball[10];
- void setup() {
- size(500, 500);
- for(int i = 0; i< Balls.length; i++){
- Balls[i] = new Ball(int(random(1,7)),int(random(50,width-50)),
- int(random(50,height-50)),int(random(20,60)));
- }
- }
- void draw() {
- background(255);
- for (int i=0; i < Balls.length; i++) {
- Balls[i].Display();
- Balls[i].Move();
- }
- }
- void mouseClicked() {
- for (int i=0; i < Balls.length; i++) {
- Balls[i].Bounce();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement