I want to make something that will make all of the numbers that the int array outputs and make it into a variable that i can pass to a different world.
int [] num = new int [4];
num [0] = 5+Greenfoot.getRandomNumber(2);
num [1] = 5+Greenfoot.getRandomNumber(2);
num [2] = 5+Greenfoot.getRandomNumber(2);
num [3] = 5+Greenfoot.getRandomNumber(2);
for (int i=0; i<num.length; i++)
{
for (int n=0; n<num[i]; n++)
{
int randomX = Greenfoot.getRandomNumber(getWidth()-50)+25;
int randomY = Greenfoot.getRandomNumber(getHeight()-50)+25;
Ball0 ball = new Ball0(i);
addObject(ball, randomX,randomY);
}
}
}
