making a game and i want to make it so that when the player collects a certain number of objects it goes to the next level


1 2 3 4 5 6 7 | // in the player class private int coinNum; // in act method if (coinNum= 5 ) { Greenfoot.setWorld( new next()); } |
1 | if (coinNum == 5 ) |
1 2 3 4 5 6 7 8 9 10 11 12 13 | private int coinNum; //in act method Actor coin(); coin = setOneObjectAtOffset( 0 , 0 ,Coin. class ); if (coin != null ) { Greenfoot.removeObject(Coin. class ); coinNum + 1 ; } if (coinNum== 5 ) { Greenfoot.setWorld( new next()); } |