This commit is contained in:
Renan LE CARO 2025-04-23 10:56:50 +02:00
parent 181e156f60
commit 0ec9cdf798
17 changed files with 2089 additions and 2227 deletions

View file

@ -6,7 +6,7 @@ import { rawUpgrades } from "./upgrades";
import { getLevelBackground } from "./getLevelBackground";
import { levelIconHTML } from "./levelIcon";
import {automaticBackgroundColor} from "./pure_functions";
import { automaticBackgroundColor } from "./pure_functions";
const palette = _palette as Palette;
@ -17,8 +17,7 @@ export const appVersion = _appVersion as string;
export const icons = {} as { [k: string]: string };
export function transformRawLevel(level: RawLevel) {
const splitBricks=level.bricks
.split("")
const splitBricks = level.bricks.split("");
const bricks = splitBricks
.map((c) => palette[c])
.slice(0, level.size * level.size);
@ -30,7 +29,7 @@ export function transformRawLevel(level: RawLevel) {
bricks,
bricksCount,
icon,
color: automaticBackgroundColor(splitBricks) ,
color: automaticBackgroundColor(splitBricks),
svg: getLevelBackground(level),
sortKey: ((Math.random() + 3) / 3.5) * bricksCount,
};