hey, i have a problem with an method call spwanhinderniss the thing is i want to spwan obsticals (hinderniss) but only at a maxium of 5 so if there a 4 or less spwan 1,2,3,4 or 5 but i dont no how to do it so pls help thanks :)
public void spawnhinderniss()
{
if()
{
}
else
{
hinderniss newHinderniss;
newHinderniss = new hinderniss();
int x = Greenfoot.getRandomNumber(1250) +1325;
int y = Greenfoot.getRandomNumber(600);
getWorld().addObject(newHinderniss, x, y);
}
}

