Beispiel #1
0
 /**
  * Реализация интерфейса ActionListener
  *
  * @param e
  */
 public void actionPerformed(ActionEvent e) {
   if (level.levelIsDone()) {
     level.levelStop();
     JOptionPane.showMessageDialog(null, "Level done, you scores: " + level.getPlayerScores());
     if (levelManager.isNext()) {
       level = levelManager.next();
     } else {
       gameTimer.stop();
       JOptionPane.showMessageDialog(null, "Game is done!");
       System.exit(1);
     }
   } else {
     level.tick();
   }
   repaint();
 }
Beispiel #2
0
 public GameScreen() {
   level = levelManager.first();
   addKeyListener(new GameKeyAdapter());
   setFocusable(true);
   gameTimer.start();
 }