コード例 #1
0
 @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());
     }
   }
 }
コード例 #2
0
 @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);
   }
 }