so I was making my game (which really isn't very big) and I was making the 2nd wave of zombies and when it spawns in this happens
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
which is weird because of how small my game actually is please help.
This is what I made when it started happening
public void secondWave()
{
if(Bullet.killCount >= 9 && secondWave == 0)
{
for(int c = 0; c < 5; c = c++)
{
int x = getWorld().getWidth();
int y = Greenfoot.getRandomNumber(getWorld().getHeight());
getWorld().addObject(new Zombie(), x, y);
}
for(int c = 0; c < 5; c = c++)
{
int x = 0;
int y = Greenfoot.getRandomNumber(getWorld().getHeight());
getWorld().addObject(new Zombie(), x, y);
}
secondWave++;
}
}

