Exemple #1
0
 protected void onOptions() {
   if (JOptionPane.showConfirmDialog(
           new JFrame(),
           "This will reset any current games. Continue?",
           "Options Change",
           JOptionPane.YES_NO_OPTION)
       == JOptionPane.YES_OPTION) {
     _optionsDialog = new OptionsDialog(this);
     _optionsDialog.setVisible(true);
   }
 }
Exemple #2
0
  protected void levelFailed(Graphics2D g) {
    try {
      InputStream in = getClass().getResourceAsStream("/sounds/fail.wav");
      m_as = new AudioStream(in);
      AudioPlayer.player.start(m_as);
    } catch (IOException e) {
    }

    _balls--;
    if (_balls == 0) {
      resetGame();
      JOptionPane.showMessageDialog(
          null, "Game Over! Your score was " + _score + " and you reached level " + _level + ".");
    } else {
      _canvas.getBall().resetPosition();
      _canvas.drawField(g);
    }
    repaint();

    _appState = Constants.appStates.Paused;
  }
Exemple #3
0
 protected void onAbout() {
   JOptionPane.showMessageDialog(null, "Breakout! (c) 2009 Ben Lakey");
 }