Improve menu control via ESC and fix display error

This commit is contained in:
Marcel
2018-01-25 20:54:13 +01:00
parent 85bd2470a7
commit eb95653ba1
3 changed files with 27 additions and 18 deletions

View File

@@ -69,7 +69,6 @@ function arenaSweep() {
}
function centerOffset(matrix) {
// const tempMatrix = rotate(matrix, 1);
let offsetX = 0;
let offsetY = 0;
matrix.forEach((row, y) => {
@@ -99,18 +98,6 @@ function centerOffset(matrix) {
offsetX += .5;
}
}
// tempMatrix.forEach((col, x) => {
// let onlyZeroes = true;
// col.forEach((value, y) => {
// if (value > 0) {
// onlyZeroes = false;
// }
// });
// if (onlyZeroes)
// matrix.forEach((row, y) => {
// matrix[y].splice(x, 1);
// });
// });
return {x: offsetX, y: offsetY};
}
@@ -262,7 +249,6 @@ function drawTile(x, y, offset, color, matrix, useContext = context) {
const ctx = useContext;
switch (theme) {
case "default":
if (ctx === holdContext)
ctx.fillStyle = color;
ctx.fillRect(x + offset.x + tileGap / 2, y + offset.y + tileGap / 2, 1 - tileGap, 1 - tileGap);
break;