So I need to make an object X disappear once the actor has picked up 3 different objects. Could anyone help me?


1 2 3 4 5 6 7 8 9 10 11 | private int countCollected; public void act() { // other action codes if (isTouching(Collectible. class )) { removeTouching(Collectible. class ); if (++countCollected == 3 ) getWorld().removeObject( this ); } } |
1 2 3 4 5 6 7 8 9 10 11 | private int countCollected; public void act() { // other action codes if (isTouching(Collectible. class )) { removeTouching(Collectible. class ); if (++countCollected == 3 ) getWorld().removeObject( this ); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | public void takeBout(){ Actor bout; bout = getOneObjectAtOffset( 0 , 0 , Bout. class ); if (bout != null ) { World world; world = getWorld(); getWorld().getCounter().addScore( 1 ); here it says cannot find symbol - method getCounter() world.removeObject(bout); } } |