示例#1
0
 public void handleInput() {
   InputHandler input = Game.getInstance().getInputHandler();
   if (input.isSpacePressed()) {
     // If previous state complete
     if (state.isComplete()) {
       // Jump again
       state = new PlayerJumping(this);
     }
   }
   // if not running and previous state complete, run again
   else if (!(state instanceof PlayerRunning) && state.isComplete())
     state = new PlayerRunning(this);
 }
示例#2
0
 @Override
 public void update(long elapsedTime) {
   Game.getInstance().endGame();
 }