Minesweeper is a logic game where mines are hidden in a grid of squares. The object is to reveal all the safe squares without stepping on a mine. The game became famous when Microsoft included it with Windows 3.1 but its origins go even further back.
This weekend's lab is to build a front end interface to Minesweeper against a backend API. The API will handle all of the game logic for you.
The API endpoints will be at that domain as well, i.e., https://minesweeper-api.herokuapp.com/game. I will have that live for you later tonight!
Deliverables
[ ] A publicly visible website on gh-pages, etc.
[ ] A repository on GitHub with your app's source code
Explorer Mode
Have at least two screens:
[ ] The player chooses the difficulty to start a new game
[ ] A game board, consisting of a grid of squares.
[ ] Players should be able to click to reveal a given cell (this will map the check action of the Game API).
[ ] Players should be able to double click to flag a given cell (this will map the flag action of the Game API).
[ ] The board should re-render it self based on the array of data the API actions respond with.
[ ] The numbers of mines remaining should be included in this update.
[ ] Include a timer that counts up from 0 while the player is playing.
[ ] Players should not be able to "check" a flagged cell.
[ ] Your game should look great!
Adventure Mode
The design of clicking and double clicking to reveal and flag squares is risky, it's too easy for players to misclick and reveal a bomb they meant to flagg! Unfortunately the DOM doesn't have an event for "right click".
Your task for Adventure Mode is to make the game work like the Windows game and allow you to right click on a cell to place a flag. Hint: event.which.
Epic Mode
"Offline" play. Implement the game's logic yourself rather than use the external API.
Minesweeper
Description
Minesweeper is a logic game where mines are hidden in a grid of squares. The object is to reveal all the safe squares without stepping on a mine. The game became famous when Microsoft included it with Windows 3.1 but its origins go even further back.
This weekend's lab is to build a front end interface to Minesweeper against a backend API. The API will handle all of the game logic for you.
The API documentation is available at https://minesweeper-api.herokuapp.com
The API endpoints will be at that domain as well, i.e.,
https://minesweeper-api.herokuapp.com/game
. I will have that live for you later tonight!Deliverables
gh-pages
, etc.Explorer Mode
check
action of the Game API).flag
action of the Game API).Adventure Mode
The design of clicking and double clicking to reveal and flag squares is risky, it's too easy for players to misclick and reveal a bomb they meant to flagg! Unfortunately the DOM doesn't have an event for "right click".
Your task for Adventure Mode is to make the game work like the Windows game and allow you to right click on a cell to place a flag. Hint:
event.which
.Epic Mode
"Offline" play. Implement the game's logic yourself rather than use the external API.
Additional Resources