Add whack a pumpkin and best score, move games to game_info and setup_game, make a modular basegame template and build upon that, fix game settings not using the current game specific settings

This commit is contained in:
csd4ni3l
2025-11-02 21:23:09 +01:00
parent 7094603bd7
commit 0904eede95
13 changed files with 245 additions and 102 deletions

View File

@@ -66,15 +66,17 @@ function show_settings(category, GAME_TITLE, SETTINGS) {
}
function start_game() {
const [GAME_TITLE, SETTINGS] = game_info();
kaplay(
{
width: WIDTH,
height: HEIGHT,
canvas: document.getElementById("canvas"),
root: document.getElementById("game-container"),
crisp: !localStorage.getItem("Anti-Alasing"),
texFilter: (localStorage.getItem("Texture Filtering") || "nearest").toLowerCase(),
maxFPS: Number(localStorage.getItem("FPS Limit")),
crisp: !localStorage.getItem(`${GAME_TITLE} Anti-Aliasing`),
texFilter: (localStorage.getItem(`${GAME_TITLE} Texture Filtering`) || "nearest").toLowerCase(),
maxFPS: Number(localStorage.getItem(`${GAME_TITLE} FPS Limit`)),
font: "New Rocker",
background: "#e18888",
buttons: {
@@ -90,8 +92,8 @@ function start_game() {
}
);
const [GAME_TITLE, SETTINGS] = setup_game();
setup_game();
scene("settings", (setting_category) => {
let generated_button_lists = Object.entries(SETTINGS).map(([key, value]) => [key, color(127, 127, 127), color(0, 0, 0, 0), scene_lambda("settings", key)]);
generated_button_lists = [["Back", color(127, 127, 127), color(0, 0, 0, 0), scene_lambda("main_menu")]].concat(generated_button_lists);