Chapter 2. Minesweeper

Minesweeper is a single player turn-based game whose goal is to clear a mine field without being killed by a mine. The mine field is represented by a grid of covered tiles, some of them hiding a mine. Grid size and number of mined tiles vary according to difficulty level. At each turn, the player must pick a tile with a mouse click. If he clicks on a tile without a mine, a digit with the amount of adjacent tiles containing a mine will appear. Using logic, the player must click all free tiles. If he hits a mine, the game is over. With a right-click on the tile, the player can "flag" that tile, to help him remember where he thinks there is a mine. In some versions, the player must flag all mines.

In this chapter you will learn ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.