You can play the game at https://kalyak.github.io/Minesweeper/game/minesweeper.html
General Objective:
- Create an interactive game using HTML, CSS and Javascript.
- Use DOM manipulation in Javascript that is triggered by a browser event.
Personal Objective:
- Create a variable field onscreen and hide and show elements as needed.
- Have at least 1 other color theme to toggle between.
This game requires you to navigate a field riddled with mines sensitive to clicking. How do you clear the grid without triggering any of the mines?
Don't worry! The people who buried the mines had to get out of the field safely somehow, and left behind their markers denoting how many mines are surrounding a plot and the number of mines they planted.
Dig up all the plots around the mines, or flag all the mines, help your fellow living folks not blow themselves up!
-
Select your game level:
Tutorial - Easy mode with one blank space pre-revealed Easy - 10 x 10 field with 10 mines
Medium - 13 x 16 field with 40 mines
Hard - 30 x 16 field with 99 mines -
Controls:
Left click - reveals the content of the plot. Numbers represent the count of mines adjacent to the plot (corners included). You cannot left click on a plot when it is flagged.
Right click - toggle the flagging/unflagging of the plot where you think the mine is. You cannot left click on this plot while it is flagged. -
Win Conditions:
100% Accurate flagging - all flags on the field are on the same plot as the mines. If the number of flags are more than the number of mines, the game is not yet over.
All non-mine plots revealed - all plots other than the mines are revealed with no mines triggered. Flagged plots are not considered revealed. -
Lose Conditions:
Any one mine being revealed will lose the game.
Javascript, JQuery, HTML, CSS
- Started off with a fix 3x3 grid and a have it be built onto the page using DOM manipulation.
- Build function for the reveal of all adjacent squares recursively if a blank cell is revealed working.
- Build function for win and lose conditions.
- Build function for building the variable size grid array.
- Build function for generating unique mine coordinates.
- Build functions for popluating grid array with mine and clues surrounding the mines.
- Add buttons and stylings and small improvements to augment the game experience.
- Tracking the game state in the Javascript instead of in the HTML.
- Mobile optimization.
- Icon pack.
- Instruction page.
- Hover effect on where the mouse is.
- Explosion effect when mine is revealed.