Why wont this respawn code work? Could you tell me a code that would?
Actor lobster;
lobster = new Lobster();
if(lobster = null)
{
addObject(lobster,100,342);
}


if (getObjects(Lobster.class).size() == 0) { addObject(new Lobster(),100,342); }
and
public void act() { if (getObjects(Lobster.class).size() == 0) { addObject(new Lobster(),100,342); } }
/** * Runs the scrolling. */ public void act() { scrollObjects(); scrollBackground(); }
/** * Runs the scrolling. */ public void act() { scrollObjects(); scrollBackground(); if (getObjects(Lobster.class).size() == 0) { setMainActor(new Lobster(), 250, 300); mainActor.setLocation(100, 342); } }