So in the code below I am spawning random monkeys called harambe. This code is in the act method in the world class. So the problem I am having is I want to spawn a DK monkey after a certain amount of harambes have been spawned. I tried with the count, as seen in the code but it didn't work. Also how can I stop harambes from spawning so i can spawn one big DK?
public void act()
{
int x = Greenfoot.getRandomNumber(1000);
int count = 0;
if (x >=960)
{
count++;
addObject(new Harambe(), -10,429);
}
if( count == 2)
{
addObject(new DK(), -10,390);
}
}
