From 564d33ac255212d83e09850e5e479a2844862202 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 22 Sep 2018 13:07:54 -0400 Subject: + difficulty selector + cursor change on the game status indicator --- mines.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mines.js') 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 -- cgit v1.2.3