Пример #1
0
  @Override
  public void onEvent(Point p) {
    if (this.checkHit(p)) {
      Helper.println("Button Restart Hit in game over screen: " + p.toString());

      //			GlobalVars.ge.getCurrentStage().setGameState(GameState.PLAYING);
      //			GlobalVars.ge.getCurrentStage().reload();

      if (res instanceof ResultBTRMAP)
        GlobalVars.ge.loadStage(new XLevel(level_id, new ResultBTRMAP()));
      else if (res instanceof ResultBTRClassic)
        GlobalVars.ge.loadStage(new XLevel(level_id, new ResultBTRClassic()));
      else if (res instanceof ResultBTRTime)
        GlobalVars.ge.loadStage(new XLevel(level_id, new ResultBTRTime()));
    }
  }
Пример #2
0
 @Override
 public void onTouch(Point p) {
   if (this.checkHit(p)) {
     Helper.println("Button Pause Hit : " + p.toString());
     Helper.println(
         "Button Pause Hit : Current Game state : "
             + GlobalVars.ge.getCurrentStage().getGameState());
     if (GlobalVars.ge.getCurrentStage().getGameState() == GameState.PLAYING) {
       GlobalVars.ge.getCurrentStage().pause();
       this.image = imagePlay;
     } else if (GlobalVars.ge.getCurrentStage().getGameState() == GameState.PAUSED) {
       GlobalVars.ge.getCurrentStage().resume();
       this.image = imagePause;
     }
     Helper.println(
         "Button Pause Hit : Game state set: " + GlobalVars.ge.getCurrentStage().getGameState());
   }
 }