Is there any way i can remember integers amounts that were used in a world and re-use them in the same world later on after i used Greenfoot.setWorld(new BackgroundLvL1());


// add instance field private World previousWorld; // change constructor declaration line to public BackgroundLvL1(World world) // add the following line in the constructor previousWorld = world;
Greenfoot.setWorld(previousWorld);
public World getPreviousWorld() { return previousWorld; }
Greenfoot.setWorld(((InterimWorldClassName)getWorld()).getPreviousWorld());
public World getPreviousWorld() { return previousWorld; }
Greenfoot.setWorld(((InterimWorldClassName)getWorld()).getPreviousWorld());
// add instance field private World previousWorld; // change constructor declaration line to public BackgroundLvL1(World world) // add the following line in the constructor previousWorld = world;
Greenfoot.setWorld(previousWorld);