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++) {
...
Type: Posts; User: jusjus7
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++) {
...
int ballDiameter = 56+59*i; < thats where the size is changed
i holds the variable
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...
size is held in
class bouncingball
public BouncingBall(int xPos, int yPos, int ballDiameter, Color ballColor,
int groundPos, Canvas drawingCanvas)
{
...
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...
Can anybody please help? really stuck
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...
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...