Compare commits

...

3 Commits

Author SHA1 Message Date
csd4ni3l
7a8fdd64ba Fix README saying 2 instead of 3 minigames 2025-11-03 15:24:55 +01:00
csd4ni3l
31973ad9d3 fix best time being None for 0.1s which looked bad 2025-11-03 15:23:36 +01:00
csd4ni3l
60bf2a65be Fix music always playing, add more jumpscares and increase chance of jumpscares 2025-11-03 15:15:50 +01:00
5 changed files with 22 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
LoginWeen is an app where you login/register with a halloween pumpkin carving as a password.
There are 2 minigames you can play after, or you can check out the countdown to the next Loginween!
There are 3 minigames you can play after, or you can check out the countdown to the next Loginween!
Live Demo: https://loginween.csd4ni3l.hu

View File

@@ -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;
}

View File

@@ -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;
@@ -73,8 +79,8 @@ function setup_game() {
let best_time = Number(localStorage.getItem("pumpkin_memory_best_time")) || 99999;
let first_time = best_time == 99999;
const best_time_display = (best_time == 99999) ? "None" : `${best_time}s`;
const elapsed = performance.now() - start;
const best_time_display = (best_time == 99999) ? `${(elapsed / 1000).toFixed(1)}s` : `${best_time}s`;
const timer_label = create_label(400, 5, `Time spent: ${(elapsed / 1000).toFixed(1)}s Best Time: ${best_time_display}`);
const timer_interval_id = setInterval(() => {
@@ -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);
@@ -111,7 +117,7 @@ function setup_game() {
}
localStorage.setItem(`memory_best_${difficulty}`, best_time);
const best_time_display = (best_time == 99999) ? "None" : `${best_time}s`;
const best_time_display = (best_time == 99999) ? `${(elapsed / 1000).toFixed(1)}s` : `${best_time}s`;
create_label(520, 320, `You win!\nTime took: ${(elapsed / 1000).toFixed(1)} s\nBest Time: ${best_time_display}`, 48);
return;
}

View File

@@ -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") {

View File

@@ -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;