![]() ![]() The general use of scopes - Sometimes I found the need to use global variables although I'm used to them being considered a bad habit.I am pretty happy with the current state and I am posting here after a few iterations and changes, but since this is basically my first big JS/HTML/CSS project I wanted to get it reviewed especially on: A mine counter showing the current amount of unflagged mines (this relies on flags so it might not be correct at a given moment).The use of flags with a right-click (or long press on mobile).Auto-reveal when clicking an empty cell.A timer of the game which stops when the game is over (win or lose), and resets when it starts.Selection of size and difficulty (number of mines). ![]() The number in the cell tells us how many mines exist in the immediate vicinity of this cell (an empty cell is equivalent to a cell with a 0 in it). Mines are randomly placed on the board and the goal is to reveal the whole board, except for the mines! Each revealed cell will either have a mine, a number or be empty. Just to make the question self-contained: Mine Sweeper is a game with a rectangular board consisting of hidden cells. ![]() I decided to write my own version of a Mine Sweeper game as an excuse for a Javascript/HTML/CSS project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |