Graphics change, more light thanks to optimized computations

This commit is contained in:
Renan LE CARO 2025-04-03 15:15:00 +02:00
parent 83c79b6564
commit ba7e368938
16 changed files with 215 additions and 90 deletions

View file

@ -2,14 +2,8 @@ import { RawLevel } from "./types";
import _backgrounds from "./data/backgrounds.json";
const backgrounds = _backgrounds as string[];
export function getLevelBackground(level: RawLevel) {
let svg = level.svg !== null && backgrounds[level.svg % backgrounds.length];
if (!level.color && !svg) {
svg = backgrounds[hashCode(level.name) % backgrounds.length];
}
return svg;
return backgrounds[hashCode(level.name) % backgrounds.length];
}
export function hashCode(string: string) {