Skip to content

Commit 40b3d34

Browse files
committed
📝 (mine-sweeper): add default draw comment
1 parent 94c2217 commit 40b3d34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/layout/layout.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func (g *GameLayout) Update() error {
2828
return nil
2929
}
3030

31+
// drawUnTouchCell - 畫出沒有被掀開的格子
3132
func (g *GameLayout) drawUnTouchCell(screen *ebiten.Image, row, col int) {
3233
vector.DrawFilledRect(
3334
screen,
@@ -39,10 +40,13 @@ func (g *GameLayout) drawUnTouchCell(screen *ebiten.Image, row, col int) {
3940
false,
4041
)
4142
}
43+
4244
func (g *GameLayout) Draw(screen *ebiten.Image) {
4345
for row := 0; row < Rows; row++ {
4446
for col := 0; col < Cols; col++ {
47+
// 取出格子狀態
4548
cell := g.gameInstance.Board.GetCell(row, col)
49+
// 當格子沒有被掀開時,畫出原本的灰階
4650
if !cell.Revealed {
4751
g.drawUnTouchCell(screen, row, col)
4852
}

0 commit comments

Comments
 (0)