diff --git a/static/js/game.js b/static/js/game.js index fb4a395..76d6e2c 100644 --- a/static/js/game.js +++ b/static/js/game.js @@ -141,7 +141,7 @@ function start_game() { scene("main_menu", () => { create_label(WIDTH / 2 - 16 * GAME_TITLE.length, HEIGHT / 4, GAME_TITLE, 56); vertical_buttons(WIDTH / 4, HEIGHT / 2.25, [["Play", color(127, 127, 127), color(0, 0, 0, 0), scene_lambda("play")], ["Settings", color(127, 127, 127), color(0, 0, 0, 0), scene_lambda("settings")]], WIDTH / 2, HEIGHT / 8, HEIGHT / 50) - if (!music_played) { + if (!music_played && localStorage.getItem(`${GAME_TITLE} Music`) == 'true') { create_start_overlay(GAME_TITLE); music_played = true; } diff --git a/static/js/pumpkin_memory.js b/static/js/pumpkin_memory.js index 3dce6e0..2566a7e 100644 --- a/static/js/pumpkin_memory.js +++ b/static/js/pumpkin_memory.js @@ -21,6 +21,12 @@ function setup_game() { loadSprite("pumpkin", "/static/graphics/pumpkin.png"); scene("game", (difficulty, pumpkin_array, revealed, found_pairs, start) => { + if (localStorage.getItem("Pumpkin Memory Jumpscares") == "true") { + if (Math.random() < 0.1) { + jumpscare(); + } + } + let cols; switch (difficulty) { case "easy": pumpkin_pairs = 5; cols = 5; break; @@ -89,7 +95,7 @@ function setup_game() { let jumpscare_interval_id; if (localStorage.getItem("Pumpkin Memory Jumpscares") == "true") { jumpscare_interval_id = setInterval(() => { - if (Math.random() < 0.035) { + if (Math.random() < 0.05) { jumpscare(); } }, 1000); diff --git a/static/js/pumpkin_roll.js b/static/js/pumpkin_roll.js index ac47037..8311659 100644 --- a/static/js/pumpkin_roll.js +++ b/static/js/pumpkin_roll.js @@ -108,6 +108,10 @@ function setup_game() { destroy(enemy); } + if (localStorage.getItem("Pumpkin Roll Jumpscares") == "true") { + jumpscare(); + } + create_label(520, 320, `Game Over!\nScore: ${Math.floor(score)}\nHigh Score: ${high_score}`, 48); if (localStorage.getItem("Pumpkin Roll Jumpscares") == "true") { diff --git a/static/js/whack_a_pumpkin.js b/static/js/whack_a_pumpkin.js index 3b5739f..70568e4 100644 --- a/static/js/whack_a_pumpkin.js +++ b/static/js/whack_a_pumpkin.js @@ -72,7 +72,7 @@ function setup_game() { let jumpscare_interval_id; if (localStorage.getItem("Whack a Pumpkin Jumpscares") == "true") { jumpscare_interval_id = setInterval(() => { - if (Math.random() < 0.035) { + if (Math.random() < 0.05) { jumpscare(); } }, 1000); @@ -100,7 +100,12 @@ function setup_game() { onClick("pumpkin", (pumpkin) => { destroy(pumpkin); - + if (localStorage.getItem("Whack a Pumpkin Jumpscares") == "true") { + if (Math.random() < 0.1) { + jumpscare(); + } + } + score += 1; if (score > high_score) { high_score = score;