//@Override public override void setReleasedButton(Keys code) { switch (code) { case Keys.Up: break; case Keys.Down: megaMan.standUp(); break; case Keys.Right: if (megaMan.getSpeedX() > 0) { megaMan.stopRun(); } break; case Keys.Left: if (megaMan.getSpeedX() < 0) { megaMan.stopRun(); } break; case Keys.Enter: if (state == GameState.GAMEOVER || state == GameState.GAMEWIN) { //gamePanel.setState(new MenuState(gamePanel, gameTime)); } else if (state == GameState.PAUSEGAME) { state = lastState; } break; case Keys.Space: break; case Keys.A: break; case Keys.Escape: lastState = state; state = GameState.PAUSEGAME; break; } }