# Search:

Type: Posts; User: jusjus7

1. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### Re: need to randomly change the size of programs balls

i have managed to do it thanks for your help

Random random = new Random();
HashSet<BouncingBall> balls = new HashSet<BouncingBall>();
for(int i=0; i<numberOfBalls; i++) {
...
2. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### Re: need to randomly change the size of programs balls

int ballDiameter = 56+59*i; < thats where the size is changed

i holds the variable
3. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### Re: need to randomly change the size of programs balls

yes thats the size

int ballDiameter = 56+59*i; is changes the size of the ball but its not random

Random random = new Random();
HashSet<BouncingBall> balls = new...
4. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### Re: need to randomly change the size of programs balls

size is held in

class bouncingball

public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
int groundPos, Canvas drawingCanvas)
{
...
5. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### Re: need to randomly change the size of programs balls

Ok sorry, below are my three classes. I have been able to get the balls to randomly bounce but not to randomly change size.

import java.awt.*;
import java.awt.geom.*;
import...

by jusjus7
Replies
15
Views
360

7. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### need to randomly change the size of programs balls

I am starting to learn java at home and one of the tasks in the book is to create a program which randomly changes the size of balls which are bouncing off the screen, but all i seem to be able to do...
8. ## Thread: need to randomly change the size of programs balls

by jusjus7
Replies
15
Views
360

### need to randomly change the size of programs balls

I am starting to learn java at home and one of the tasks in the book is to create a program which randomly changes the size of balls which are bouncing off the screen, but all i seem to be able to do...
Results 1 to 8 of 9