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


1 | if (counter== 100 ) Greenfoot.setWorld( new Level2()); |
1 | if (counter.getValue() == 100 ) Greenfoot.setWorld( new Level2()); |
1 2 3 4 5 6 7 | public void add( final int s) { value += s; //here you can add the line: if (value > 99 ) Greenfoot.setWorld( new Level2()); updateImage(); } |
1 2 3 4 5 6 | 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(); } |