@Override public void mouseClicked(int button, int x, int y, int clickCount) { for (MenuCage cage : cages) { if (cage.getRect().contains(x - mouseOffsetX, y - mouseOffsetY) && PlatformerGame.CHEATS_ENABLED) { enterCageState(cage.getToState()); } } }
@Override public void keyPressed(int key, char c) { if (key == SELECT_KEY) { for (MenuCage cage : cages) { if (cage.intersects( playerA.getPhysicalState().getRectangle(), playerB.getPhysicalState().getRectangle())) { enterCageState(cage.getToState()); } } } else { super.keyPressed(key, c); } }