Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. if (field.getState() == GameState.PLAYING) {
  2. TileComponent button = (TileComponent) e.getSource();
  3. int row = button.getRow();
  4. int column = button.getColumn();
  5. Tile tile = tiles[row][column];
  6. if (SwingUtilities.isLeftMouseButton(e)) {
  7. field.openTile(row, column);
  8. update();
  9. if (field.getState() == GameState.FAILED) {
  10. JOptionPane.showMessageDialog(this, "string", "Game Over!", JOptionPane.INFORMATION_MESSAGE);
  11. } else if (field.getState() == GameState.SOLVED) {
  12. JOptionPane.showMessageDialog(this, "string", "You Win!", JOptionPane.INFORMATION_MESSAGE);
  13. BestTimes bestTimes = new BestTimes();
  14. bestTimes.addPlayerTime(System.getProperty("user.home"), minesweeper.Minesweeper.getInstance().getPlayingSeconds());
  15. }
  16. } else if (SwingUtilities.isRightMouseButton(e)) {
  17. field.markTile(row, column);
  18. update();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement