mirror of
https://github.com/csd4ni3l/loginween.git
synced 2025-11-05 04:58:09 +01:00
Fix music always playing, add more jumpscares and increase chance of jumpscares
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user