I have a counter that is functional on level 1, however, as i move onto the next level, the counter is still there, but it is not functional and a red message pops up. I have shown the code that i have used below:
public void remove()
{
Actor person = getOneObjectAtOffset(0, 0, person.class);
if (person != null)
{
World myWorld = getWorld();
getWorld().removeObject(person);
level1 level1 = (level1) getWorld();
Counter counter = level1.getCounter();
counter.bumpCount(5);
//Level1 level1 = (Level1)myWorld;
//score score = level1.getsco();
//counter.addPoints();
}
}
