示例#1
0
文件: Play.java 项目: SlonSky/Engine
 public void checkPause() {
   if (Input.getKeyDown(Input.KEY_ESCAPE) && !checkGameOver() && !checkLevelEnded()) {
     pause = !pause;
     if (pause) {
       manager.alert(UIState.PAUSE);
     } else {
       manager.alert(UIState.GAME);
     }
   }
   if (manager.getOldState() == UIState.GAME) {
     pause = manager.isPaused();
   }
 }
示例#2
0
文件: Play.java 项目: SlonSky/Engine
 @Override
 public void render(RenderingEngine engine) {
   engine.render(level);
   if (pause || gameOver || levelEnded) {
     engine.render(manager.getMainFrame(), true);
   }
 }
示例#3
0
文件: Play.java 项目: SlonSky/Engine
 public boolean checkLevelEnded() {
   boolean res = GameplayManager.getInstance().isLevelEnded();
   if (res) {
     manager.alert(UIState.LEVEL_ENDED);
   }
   return res;
 }
示例#4
0
文件: Play.java 项目: SlonSky/Engine
 public boolean checkGameOver() {
   boolean res = GameplayManager.getInstance().isGameOver();
   if (res) {
     manager.alert(UIState.GAME_OVER);
   }
   return res;
 }
示例#5
0
文件: Play.java 项目: SlonSky/Engine
 @Override
 public void update() {
   GameplayManager.getInstance().update((Player) Level.getObjects().get(0));
   gameOver = checkGameOver();
   levelEnded = checkLevelEnded();
   checkPause();
   if (pause || gameOver || levelEnded) {
     manager.update();
   } else {
     level.input();
     level.update();
     ParticleMaster.update(camera);
   }
 }