Hi this is my first program in java , How do I make the counter when it reaches "100" trigger to go to level 2, I have the counter set up under actor in world 1 .
Any help would be grateful, thank you in advance
if (counter==100) Greenfoot.setWorld(new Level2());
if (counter.getValue() == 100) Greenfoot.setWorld(new Level2());
public void add(final int s)
{
value += s;
//here you can add the line:
if (value > 99) Greenfoot.setWorld(new Level2());
updateImage();
}public void add()
{
value++; // or value-- if the value should decrease from something to 100 (probably not though)
if (value == 100) Greenfoot.setWorld(new Level2());
updateImage();
}