I have a puzzle game, and the goal is to "push" the levers with no order, but once you go through a lever it disappears and it changes the pipe(wall) to a more damaged pipe, until it gets removed and the player goes to the next level, having 3 levels of pipe damage, which are 3 different images for each, which are on top of each other and my train of thought was to remove one by one each time you pick a lever.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public void nextNivel() { if (isTouching(Player. class )) { if (getWorld().getObjects(Lever. class ).size() == 3 ) { getWorld().removeObjects(getWorld().getObjects(FirstPipe. class )); getWorld().removeObject( this ); } if (getWorld().getObjects(FirstPipe. class ).size() = 2 ) { getWorld().removeObjects(getWorld().getObjects(Broken1. class )); } } } |