This commit is contained in:
Renan LE CARO 2025-03-20 23:11:42 +01:00
parent 0c7d729ece
commit edfc8b4f08
9 changed files with 19 additions and 11 deletions

View file

@ -1,5 +1,5 @@
// The version of the cache.
const VERSION = "29041790";
const VERSION = "29041811";
// The name of the cache
const CACHE_NAME = `breakout-71-${VERSION}`;

View file

@ -1 +1 @@
"29041790"
"29041811"

View file

@ -394,7 +394,7 @@ async function openScorePanel() {
max: max_levels(gameState),
}),
text: `
${gameState.isCreativeModeRun ? "<p>${t('score_panel.test_run}</p>" : ""}
${gameState.isCreativeModeRun ? `<p>${t("score_panel.test_run")}</p>` : ""}
<p>${t("score_panel.upgrades_picked")}</p>
<p>${pickedUpgradesHTMl(gameState)}</p>
`,

View file

@ -497,8 +497,11 @@ export function addToScore(gameState: GameState, coin: Coin) {
}
export async function setLevel(gameState: GameState, l: number) {
// Here to alleviade double upgrades issues
// Here to alleviate double upgrades issues
if (gameState.upgradesOfferedFor >= l) {
return console.warn("Extra upgrade request ignored ");
}
gameState.upgradesOfferedFor = l;
pause(false);
stopRecording();
if (l > 0) {

View file

@ -31,6 +31,7 @@ export function newGameState(params: RunParams): GameState {
const gameState: GameState = {
runLevels,
currentLevel: 0,
upgradesOfferedFor: -1,
perks,
puckWidth: 200,
baseSpeed: 12,

1
src/types.d.ts vendored
View file

@ -183,6 +183,7 @@ export type GameState = {
gridSize: number;
// 0 based index of the current level in the run (level X / 7)
currentLevel: number;
upgradesOfferedFor: number;
// 10 levels selected randomly at start for the run
runLevels: Level[];