summaryrefslogtreecommitdiff
path: root/mines.js
diff options
context:
space:
mode:
authorKyle Gunger <corechg@gmail.com>2018-09-22 13:07:54 -0400
committerKyle Gunger <corechg@gmail.com>2018-09-22 13:07:54 -0400
commit564d33ac255212d83e09850e5e479a2844862202 (patch)
treeece4b36647742b1a7985be4abb57f68150f0b166 /mines.js
parent6f9e0a05b80afb0d1cf1b5b0db21bf8d1caa1cc8 (diff)
+ difficulty selector
+ cursor change on the game status indicator
Diffstat (limited to 'mines.js')
-rw-r--r--mines.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/mines.js b/mines.js
index da0fa4d..7ea5b61 100644
--- a/mines.js
+++ b/mines.js
@@ -83,6 +83,7 @@ Board.prototype = {
}
this.mines[y].splice(this.mines[y].indexOf(x), 1);
}
+ this.clock = setInterval(this.sec.bind(this), 1000);
},
//Event managers
@@ -204,8 +205,11 @@ Board.prototype = {
let x = xIn.value;
let y = yIn.value;
+
let mines = mIn.value;
+ if(parseFloat(dIn.value) !== 0) mines = Math.round(x*y*parseFloat(dIn.value));
+
if(mines >= x*y-1) {
this.circle.className = "lose";
return;
@@ -271,6 +275,5 @@ Board.prototype = {
this.circle.className = "ingame";
this.running = true;
- this.clock = setInterval(this.sec.bind(this), 1000);
}
}; \ No newline at end of file