In java i need to create dynamic bouncingBall. like this
BouncingBall bal
BouncingBall bal2
BouncingBall bal3
I'm trying to do this with a while loop:
// Create dynamich numbers of balls
int zero = 1;
while(zero < nrOfBalls)
{
BouncingBall ball + zero = new BouncingBall(50, 50, 16, Color.BLUE, ground, myCanvas);
ball.draw();
zero++;
}
But is still saying that the +zero varbariable is not good. Could somebody help me!
@param nrOfBalls is the number what the users enters if nrOfBalls is 4 than the while loop must create 4 balls.