public void act()
{
if(Greenfoot.getRandomNumber(50) < 3) {
addObject(new brick(), Greenfoot.getRandomNumber(400), 0); // world width is 400. so they come randomly
}
}
this is how I am creating bricks to come from top. but they dont come uniformly. sometimes there are no bricks only for the doodle to jump on.
in brick class im using "move(2);"
Sounds like you need a timer that is given a random value within a range of values. Then subtract one from the counter each act method and when it is zero, add a brick and give the counter a new random value within the range. This would mean you need an instance int field, call it 'spawnTimer' in the world class and code in the world act method to check its value for zero to add a brick and give the time a new random value in the chosen range using something like: