So i want to make a game that requires something (in my case a stone) spawns every five seconds or so (it should also spawn randomly in the map). Is there any possiblity of doing this??
Thanks in advance.
private int stoneSpawn=275, stoneSpawnTimer=stoneSpawn;
public void act()
{
if (--stoneSpawnTimer==0)
{
stoneSpawnTimer=stoneSpawn;
addObject(new Stone(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
}
}public void act()
{
zufälligSteineErstellen();
}