Build 29079818

This commit is contained in:
Renan LE CARO 2025-04-16 09:38:43 +02:00
parent 871a7f9c31
commit 277aa5682b
9 changed files with 53 additions and 18 deletions

View file

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

View file

@ -1302,5 +1302,33 @@
"bricks": "___________Oyyyyyyy__Oyyyyyyy__Oyy__Oyy__Oyy_______Oyyyyyyy_______Oyy__Oyy__Oyy__Oyyyyyyy__Oyyyyyyy_",
"name": "S",
"credit": ""
},
{
"color": "",
"size": 11,
"bricks": "____________S_vvv_SSS__S___v___S__SSS_vvv_S__________S__S_vvv_SSS__S___v______SSS_vvv_S____S_____S__v_SSS_SSS____________",
"name": "Abstract 15",
"credit": "Just random strokes"
},
{
"color": "",
"size": 11,
"bricks": "________________________RRRRR_____RRRRRRRRR__kkkOOkO___kOkOOOkOOO_kOkkOOOkOOOkkOOOOkkkk___OOOOOOO________________________",
"name": "Mario!",
"credit": "Suggested by Nicolas03. A Mario level ! Sprite taken from https://art.pixilart.com/sr2d5c0683c82aws3.png . The sprite belongs to Nintendo"
},
{
"color": "",
"size": 16,
"bricks": "___llltCCttBC______lllCBBttCB______ltttBttltt______ltBrBClttt______lttCCCttBt______llttCBtttt______ltCBCttlll______ltBCCtCtCt______lttCCBCBrB______llltBCCtrB______ttttttlltt______CBrttlllll______CBrBCttttl______ttCCBttBtl______tttCCCtCCt______tBttBtltBt___",
"name": "Minesweeper",
"credit": "Suggested by Noodlemire.For once, you'll want to trigger as many mines as possible."
},
{
"color": "",
"size": 19,
"bricks": "__________________________________________________________________________________________________________________________WWW_______________WrrrW_____________WrWWWrW____________WrWBWrW____________WrWWWrW_____________WrrrW_______________WWW__________________________________________________________________________________________________________________________",
"name": "Target",
"credit": "Suggested by Noodlemire. Unusually small level, with lots of room to miss your shots. Acts as decent aim practice."
}
]

View file

@ -1 +1 @@
"29079805"
"29079818"

View file

@ -1,6 +1,11 @@
import { icons, transformRawLevel } from "./loadGameData";
import { t } from "./i18n/i18n";
import { getSettingValue, getTotalScore, setSettingValue } from "./settings";
import {
commitSettingsChangesToLocalStorage,
getSettingValue,
getTotalScore,
setSettingValue,
} from "./settings";
import { asyncAlert } from "./asyncAlert";
import { Palette, RawLevel } from "./types";
import { levelIconHTML } from "./levelIcon";

View file

@ -21,10 +21,8 @@ export function getSettingValue<T>(key: string, defaultValue: T) {
// We avoid using localstorage synchronously for perf reasons
let needsSaving: Set<string> = new Set();
export function setSettingValue<T>(key: string, value: T) {
if (cachedSettings[key] !== value) {
needsSaving.add(key);
cachedSettings[key] = value;
}
needsSaving.add(key);
cachedSettings[key] = value;
}
export function commitSettingsChangesToLocalStorage() {
try {
@ -36,7 +34,7 @@ export function commitSettingsChangesToLocalStorage() {
console.warn(e);
}
}
setInterval(commitSettingsChangesToLocalStorage, 500);
setInterval(() => commitSettingsChangesToLocalStorage(), 500);
export function getTotalScore() {
return getSettingValue("breakout_71_total_score", 0);