mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-21 04:26:14 -04:00
Updated to use typescript strict typing
This commit is contained in:
parent
62d955a233
commit
a136475f88
8 changed files with 3927 additions and 263 deletions
|
@ -69,7 +69,7 @@ function levelIconHTML(
|
|||
return `<img alt="${levelName}" width="${size}" height="${size}" src="${c.toDataURL()}"/>`;
|
||||
}
|
||||
|
||||
export const icons = {};
|
||||
export const icons = {} as {[k:string]:string};
|
||||
|
||||
export const allLevels = rawLevelsList
|
||||
.map((level) => {
|
||||
|
@ -88,7 +88,18 @@ export const allLevels = rawLevelsList
|
|||
svg,
|
||||
};
|
||||
})
|
||||
.filter((l) => !l.name.startsWith("icon:")) as Level[];
|
||||
.filter((l) => !l.name.startsWith("icon:"))
|
||||
.map((l,li)=>({
|
||||
...l,
|
||||
threshold:li < 8
|
||||
? 0
|
||||
: Math.round(
|
||||
Math.min(Math.pow(10, 1 + (li + l.size) / 30) * 10, 5000) * li,
|
||||
),
|
||||
sortKey:((Math.random() + 3) / 3.5) * l.bricks.filter((i) => i).length
|
||||
})) as Level[];
|
||||
|
||||
|
||||
|
||||
export const upgrades = rawUpgrades.map((u) => ({
|
||||
...u,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue