I have a game where new enemies gradually appear and shoot at you. Each one is identical. I'm having a problem, however, where only the original enemy will fire bullets, and no other enemy will. The bullets fire randomly.
The enemy's code looks like this
Actor ninja;
ninja = getOneObjectAtOffset(0, 0, Ninja.class);
int ninX = ((Ninja) getWorld().getObjects(Ninja.class).get(0)).getX();
int ninY = ((Ninja) getWorld().getObjects(Ninja.class).get(0)).getY();
if(Greenfoot.getRandomNumber(500) < 2)
{
getWorld().addObject(new Bullet(), ninX, ninY);
}

