Example #1
0
  /** Get ready for a new game, given a letter list specification of the Boggle board. */
  public void newGame() {

    myBoard = BoggleBoardFactory.getBoard(myBoardSize);

    // set up views for new game
    if (myBoardSize == 4) {
      if (myBoardPanel != myBoardPanel4) {
        myBoardPanel = myBoardPanel4;
        getContentPane().remove(myBoardPanel5);
        getContentPane().add(myBoardPanel, BorderLayout.CENTER);
      }
    } else {
      if (myBoardPanel != myBoardPanel5) {
        myBoardPanel = myBoardPanel5;
        getContentPane().remove(myBoardPanel4);
        getContentPane().add(myBoardPanel, BorderLayout.CENTER);
      }
    }

    myBoardPanel.newGame();
    humanArea.setReady();
    computerArea.setReady();
    myBoardPanel.unHighlightAllDice();
    wordEntryField.setReady();
    ((JPanel) getContentPane()).revalidate();
    repaint();
  }
Example #2
0
 public void gameOver() {
   myTimer.stop();
   mySeconds = myGameLength; // ensure over
   myProgress.setValue(myGameLength);
   repaint();
   wordEntryField.setUnready();
   computerPlay();
 }
Example #3
0
 public void gameOver() {
   repaint();
   wordEntryField.setUnready();
   computerPlay();
 }