views:

74

answers:

1

hi,

I have made a mine sweeper game which fully works except for one key point, which is:

Allow the player to place flags on cells to mark mine locations and to remove flags. if a cell is marked with a flag the player can not activate it by clicking on it.

Now I don't know how to do this flag requirement.

A: 

If you're asking for a hint on how to do that, a safe way to go is to make the playfield a 2D array and each item of the array an object holding certain information. (In your case that's probably a boolean telling whether the cell contains a mine and a boolean telling whether the cell is marked or not.)

Tomas Brambora
If you were implementing something similar to Microsoft's minesweeper, you would need more than a bool, as a given square can have multiple states
Aaron M