little changes
This commit is contained in:
parent
01cecac2a5
commit
12080960f4
@ -1,10 +1,12 @@
|
|||||||
.invisible-grid > .empty-cell {
|
.empty-cell {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invisible-grid > .empty-cell {
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visible-grid > .empty-cell {
|
.visible-grid > .empty-cell {
|
||||||
background: transparent;
|
|
||||||
border: 1px inset rgba(128, 128, 128, 0.3);
|
border: 1px inset rgba(128, 128, 128, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,11 +55,11 @@
|
|||||||
.trail {
|
.trail {
|
||||||
background: rgba(255, 255, 255, 0.2);
|
background: rgba(255, 255, 255, 0.2);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
border-radius: 0vmin;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ghost {
|
.ghost {
|
||||||
background: rgba(255, 255, 255, 0.4);
|
background: rgba(255, 255, 255, 0.4);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||||
border-radius: 0vmin;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
@ -302,14 +302,6 @@ class Matrix extends MinoesTable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// trail
|
|
||||||
if (this.trail.height) {
|
|
||||||
this.trail.minoesPos.forEach(pos => {
|
|
||||||
for (var y = pos.y; y < pos.y + this.trail.height; y++)
|
|
||||||
this.drawMino(pos.x, y, CLASSNAME.TRAIL)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//ghost
|
//ghost
|
||||||
if (showGhost && !this.piece.locked && state != STATE.GAME_OVER) {
|
if (showGhost && !this.piece.locked && state != STATE.GAME_OVER) {
|
||||||
for (var ghost = this.piece.ghost; this.spaceToMove(ghost.minoesAbsPos); ghost.pos.y++) {}
|
for (var ghost = this.piece.ghost; this.spaceToMove(ghost.minoesAbsPos); ghost.pos.y++) {}
|
||||||
@ -318,6 +310,15 @@ class Matrix extends MinoesTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.drawPiece(this.piece)
|
this.drawPiece(this.piece)
|
||||||
|
|
||||||
|
// trail
|
||||||
|
if (this.trail.height) {
|
||||||
|
this.trail.minoesPos.forEach(pos => {
|
||||||
|
for (var y = pos.y; y < pos.y + this.trail.height; y++)
|
||||||
|
if (this.table.rows[y].cells[pos.x].className == CLASSNAME.EMPTY_CELL)
|
||||||
|
this.drawMino(pos.x, y, CLASSNAME.TRAIL)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -601,7 +602,7 @@ function gameOver() {
|
|||||||
removeEventListener("keydown", keyDownHandler, false)
|
removeEventListener("keydown", keyDownHandler, false)
|
||||||
removeEventListener("keyup", keyUpHandler, false)
|
removeEventListener("keyup", keyUpHandler, false)
|
||||||
|
|
||||||
var info = `GAME OVER\nScore : ${stats.score}`
|
var info = `GAME OVER\nScore : ${stats.score.toLocaleString()}`
|
||||||
if (stats.score == stats.highScore) {
|
if (stats.score == stats.highScore) {
|
||||||
localStorage.setItem('highScore', stats.highScore)
|
localStorage.setItem('highScore', stats.highScore)
|
||||||
info += "\nBravo ! Vous avez battu votre précédent record."
|
info += "\nBravo ! Vous avez battu votre précédent record."
|
||||||
@ -962,6 +963,7 @@ window.onload = function() {
|
|||||||
document.getElementById("startLevel").value = localStorage.getItem("startLevel") || 1
|
document.getElementById("startLevel").value = localStorage.getItem("startLevel") || 1
|
||||||
|
|
||||||
document.getElementById("startButton").disabled = false
|
document.getElementById("startButton").disabled = false
|
||||||
|
document.getElementById("startButton").focus();
|
||||||
document.getElementById("settingsButton").disabled = false
|
document.getElementById("settingsButton").disabled = false
|
||||||
messageDiv = document.getElementById("message")
|
messageDiv = document.getElementById("message")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user