diff options
author | Kyle Gunger <corechg@gmail.com> | 2018-09-22 13:07:54 -0400 |
---|---|---|
committer | Kyle Gunger <corechg@gmail.com> | 2018-09-22 13:07:54 -0400 |
commit | 564d33ac255212d83e09850e5e479a2844862202 (patch) | |
tree | ece4b36647742b1a7985be4abb57f68150f0b166 /mines.js | |
parent | 6f9e0a05b80afb0d1cf1b5b0db21bf8d1caa1cc8 (diff) |
+ difficulty selector
+ cursor change on the game status indicator
Diffstat (limited to 'mines.js')
-rw-r--r-- | mines.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |