Minesweeper clone, named after the film "The Hurt Locker" (https://en.wikipedia.org/wiki/The_Hurt_Locker).
(The name and the images are just for fun, because they deal with mines/bombs in that film. So this is a parody. All copyright belongs to their creators.)
Unlike the original Minesweeper, which had "Board Cycles", this version is actually random. Even I don't know beforehand where the mines would be!
- JavaScript
- QUnit
- AJAX
- jQuery
- CSS
- HTML5
I welcome any pull requestions people might have for additional snippets.
I would love to support more languages as well.
Please send feedback by opening a new Issue, or by clicking on the Issues tab above. Feedback can also be sent to the person(s) in the contributor list through the links under their name(s).
- add requirejs (so that index.html won't have too many script tags)
- find a way to do event delegation for clicking the tiles.
document.getElementById("board").addEventListener("click", function(e) { e.preventDefault() alert('hello') alert( "$(this).attr('id') = " + $(this).attr('id') ) var test = $(e.target).attr('id') if ( $(this).attr('id') === $(e.target).attr('id') ) { alert("$(e.target).attr('id') = " + $(e.target).attr('id')); } })
instead of$(this).on('click', function(e){...}
, also this will get rid of this error msg:game-logic.js:25 Uncaught TypeError: Cannot read property 'NaN' of undefined
which happens when anything aside from the tiles are clicked. - modes = easy, medium, difficult - easy = 9x9 board; 10 mines - medium = 16x16 board; 40 mines - difficult = 16x30 board; 99 mines - currently, only on "easy mode"
- add timer
- add ability to place a flag with right click
- do this in React???? (maybe)