Skip to content

Commit

Permalink
cleartrail wrong background color bug fix and finally fixed black on …
Browse files Browse the repository at this point in the history
…resize bug
  • Loading branch information
arthur-adriansens authored Jan 6, 2024
1 parent b6c22e7 commit d389ce9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Game {
}

// redraw blocks
ctx.fillStyle = colors[piece?.piece];

board.forEach((row, rowIndex) => {
row.forEach((x, colIndex) => {
if (x != 0) {
Expand All @@ -51,6 +53,8 @@ class Game {
});
});

ctx.fillStyle = colors[piece?.piece];

this.shadow(false);
}

Expand Down
4 changes: 2 additions & 2 deletions src/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ const speedIcons = [
"M23.9,11.437A12,12,0,0,0,4,4.052a12.055,12.055,0,0,0-.246,17.66A4.847,4.847,0,0,0,7.114,23H16.88a4.988,4.988,0,0,0,3.508-1.429A11.942,11.942,0,0,0,23.9,11.437ZM18.99,20.142A3.005,3.005,0,0,1,16.88,21H7.114a2.863,2.863,0,0,1-1.982-.741A10.045,10.045,0,0,1,5.337,5.543a10,10,0,0,1,13.653,14.6ZM20,13a7.927,7.927,0,0,1-2.409,5.715,1,1,0,1,1-1.4-1.43C20.039,13.684,17.268,6.9,12,7a6.024,6.024,0,0,0-5.939,5.142,1,1,0,0,1-1.98-.284C5.766,2.13,19.73,3.113,20,13Zm-6,0a2.013,2.013,0,0,1-3.184,1.612L5.949,16.748a1,1,0,1,1-.8-1.832l4.867-2.136A2,2,0,0,1,14,13Z",
];

let board, game, piece, block_size, autoInterval, dropInterval;
let board, game, piece, block_size, autoInterval, dropInterval, bgColor;
let speed = 40 - Number(speedIcon.dataset.state) * 10;
let auto_speed = 750;
let username = window.localStorage.getItem("username");
let startScreen = false;
let bgColor = window.getComputedStyle(document.querySelector(".main_layout")).backgroundColor;

// event listeners
throphy_logo.onload = () => {
Expand All @@ -54,6 +53,7 @@ throphy_logo.onload = () => {
window.onload = () => {
soundtrack.loop = true;
soundtrack.volume = 0.5 * trackIcon.dataset.state;
bgColor = window.getComputedStyle(document.querySelector(".main_layout")).backgroundColor;

change_dimensions();
usernameHTML.value = username ? username : "";
Expand Down

0 comments on commit d389ce9

Please sign in to comment.