Hi All,
slightly stuck. How do I prevent the constructor from resetting the constructor values when my hero dies. This is what I have in the constructor:
When my hero dies it has this:
That basically resets the world to the first map. How I get it so that the constructor sticks to its values i.e. 3 lives, 2 lives, 1 life.
Thanks in advance!
scoreCounter = new Counter ("Score:");
lifeCounter = new Counter ("x");
coinCounter = new Counter ("x");
lifeCounter.setValue(3);
scoreCounter.setValue(0);
coinCounter.setValue(0); if(getY() >= getWorld().getHeight() + 150){
getWorld().removeObject(this);
Greenfoot.delay(50);
Greenfoot.setWorld(new Level());
}
