mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-23 13:36:15 -04:00
wip
This commit is contained in:
parent
e1c20627bc
commit
6ef13f2d19
15 changed files with 289 additions and 65 deletions
|
@ -42,13 +42,14 @@ export function getRunLevels(
|
|||
|
||||
export function newGameState(params: RunParams): GameState {
|
||||
const highScore = getHighScore();
|
||||
const totalScoreAtRunStart=getTotalScore()
|
||||
|
||||
const perks = { ...makeEmptyPerksMap(upgrades), ...(params?.perks || {}) };
|
||||
|
||||
let randomGift: PerkId | undefined = undefined;
|
||||
if (!sumOfValues(perks)) {
|
||||
const giftable = upgrades.filter(
|
||||
(u) => highScore >= u.threshold && !u.requires && isStartingPerk(u),
|
||||
(u) => totalScoreAtRunStart >= u.threshold && isStartingPerk(u),
|
||||
);
|
||||
|
||||
randomGift =
|
||||
|
@ -106,7 +107,8 @@ export function newGameState(params: RunParams): GameState {
|
|||
ballSize: 20,
|
||||
coinSize: 14,
|
||||
puckHeight: 20,
|
||||
totalScoreAtRunStart: getTotalScore(),
|
||||
|
||||
totalScoreAtRunStart,
|
||||
pauseUsesDuringRun: 0,
|
||||
keyboardPuckSpeed: 0,
|
||||
lastTick: performance.now(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue