feat: New features (research, invest, gambling, new game+, trophies)

This commit is contained in:
gauvainboiche
2026-10-08 14:03:00 +02:00
parent 1caa4d92b9
commit fc0d5e3ba4
56 changed files with 4332 additions and 249 deletions
+16 -6
View File
@@ -8,13 +8,23 @@ async function getJson(url) {
return response.json();
}
// Every data file the game needs: context key -> file name in public/data/.
export const DATA_FILES = {
rules: 'rules',
generators: 'generators',
upgrades: 'upgrades',
research: 'research',
legacy: 'legacy',
achievements: 'achievements',
investments: 'investments',
tabs: 'tabs',
};
export async function loadGameContext() {
const [rules, generators, upgrades] = await Promise.all([
getJson('data/rules.json'),
getJson('data/generators.json'),
getJson('data/upgrades.json'),
]);
return buildContext({ rules, generators, upgrades });
const entries = await Promise.all(
Object.entries(DATA_FILES).map(async ([key, file]) => [key, await getJson(`data/${file}.json`)]),
);
return buildContext(Object.fromEntries(entries));
}
/** [{ id, order, assets, locales }] discovered from public/themes/ by the server. */