First of all sorry for the spelling mistakes i hope you'll understand what i mean ;)
My question is how i can spawn these object within a range (with coordinates i guess) without coming back at places where they can't be.
i've tried different things but now i'm stuck.
This is what i have now.
Thanks
public void act()
{
if (spawnCounter++ > 625)
{
addObject(new Thief(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
spawnCounter = 1;
addObject(new Fire(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
spawnCounter = 1;
addObject(new Accident(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
spawnCounter = 1;
}
}
