Build 29126551

This commit is contained in:
Renan LE CARO 2025-05-18 20:31:58 +02:00
parent 4c135968e0
commit 810df5962a
20 changed files with 295 additions and 69 deletions

View file

@ -355,3 +355,14 @@ export function zoneLeftBorderX(gameState: GameState) {
export function zoneRightBorderX(gameState: GameState) {
return gameState.canvasWidth - gameState.offsetXRoundedDown + 1;
}
let countsCounterSet: Record<string, number> = {};
export function countBrickColors(gameState: GameState) {
for (let key in countsCounterSet) {
countsCounterSet[key] = 0;
}
gameState.bricks.forEach((brick) => {
if (brick && brick !== "black") countsCounterSet[brick] = 1;
});
return sumOfValues(countsCounterSet);
}