Merge pull request #4 from KingOfDog/dev-fix

Dev fix
This commit is contained in:
0100 1011 0100 1111 0100 0100
2018-05-10 12:40:58 +02:00
committed by GitHub
2 changed files with 8 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ function particle(x, y) {
this.yv = randInt(particlesMinSpeed, particlesMaxSpeed, false); this.yv = randInt(particlesMinSpeed, particlesMaxSpeed, false);
this.size = randInt(particlesMinSize, particlesMaxSize, true); this.size = randInt(particlesMinSize, particlesMaxSize, true);
this.r = randInt(2, 36); this.r = randInt(2, 36);
this.g = randInt(135, 150; this.g = randInt(135, 150);
this.b = randInt(190, 255); this.b = randInt(190, 255);
} }
@@ -159,4 +159,4 @@ function randInt(min, max, positive) {
} }
draw(); drawClickAnimation();

View File

@@ -1,5 +1,7 @@
const canvas = document.getElementById('minesweeper-game'); const canvas = document.getElementById('minesweeper-game');
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
const container = document.getElementById('game-container');
const timeEl = document.getElementById('time');
const fieldSize = {x: 16, y: 12}; const fieldSize = {x: 16, y: 12};
let tileSize; let tileSize;
@@ -16,6 +18,9 @@ let zoomFactor = 1;
let renderingConfig; let renderingConfig;
let startTime = 0;
let timer;
/** /**
* Defines all possible colors for the tile numbers * Defines all possible colors for the tile numbers
* @type {{ 1: string, 2: string, 3: string, 4: string, 6: string }} * @type {{ 1: string, 2: string, 3: string, 4: string, 6: string }}
@@ -482,6 +487,7 @@ overlay2Canvas.addEventListener("click", (e) => {
if (isFirstClick) { if (isFirstClick) {
initBombs(pos.x, pos.y); initBombs(pos.x, pos.y);
initTime();
isFirstClick = false; isFirstClick = false;
} }