|
|
@ -1,5 +1,6 @@ |
|
|
|
package Minesweeper; |
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Point; |
|
|
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
@ -43,11 +44,9 @@ public class Playfield { |
|
|
|
cells[i][j].setBounds(j * CELLSIZE + (MsG.WIDTH / 2 - Size * CELLSIZE / 2), |
|
|
|
i * CELLSIZE + (MsG.HEIGTH / 2 - Size * CELLSIZE / 2), CELLSIZE, CELLSIZE); |
|
|
|
MsG.add(cells[i][j]); |
|
|
|
|
|
|
|
for (int k = 0; k < bPlacement.length; k++) { |
|
|
|
if (bPlacement[k] == i * Size + j) { |
|
|
|
cells[i][j].type = CellType.Bomb; |
|
|
|
cells[i][j].update(); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -61,6 +60,7 @@ public class Playfield { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
MsG.repaint(); |
|
|
|
} |
|
|
|
|
|
|
|
public void reset() { |
|
|
@ -122,7 +122,6 @@ public class Playfield { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
cells[row][column].update(); |
|
|
|
} |
|
|
|
|
|
|
|
public void cellFlooded() { |
|
|
|