So I need to make an object X disappear once the actor has picked up 3 different objects. Could anyone help me?
private int countCollected; public void act() { // other action codes if (isTouching(Collectible.class)) { removeTouching(Collectible.class); if (++countCollected == 3) getWorld().removeObject(this); } }
private int countCollected; public void act() { // other action codes if (isTouching(Collectible.class)) { removeTouching(Collectible.class); if (++countCollected == 3) getWorld().removeObject(this); } }
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); } }