summaryrefslogtreecommitdiff
path: root/mines.js
diff options
context:
space:
mode:
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