How would I implement a way for an orb to randomly spawn? I typed up this but it spawns one and never does it again randomly each time I reset the game. I was thinking of a while loop where the orbs would stop if the player or boss died but when I tried it never did anything at all.
public void randomSpawn() {
if (Greenfoot.getRandomNumber(100) < 60)
{
Orb orb = new Orb();
addObject(orb,526,513);
}
}
