mirror of
https://github.com/csd4ni3l/loginween.git
synced 2025-11-05 05:58:10 +01:00
Compare commits
3 Commits
c616865438
...
7a8fdd64ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a8fdd64ba | ||
|
|
31973ad9d3 | ||
|
|
60bf2a65be |
@@ -1,5 +1,5 @@
|
|||||||
LoginWeen is an app where you login/register with a halloween pumpkin carving as a password.
|
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
|
Live Demo: https://loginween.csd4ni3l.hu
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ function start_game() {
|
|||||||
scene("main_menu", () => {
|
scene("main_menu", () => {
|
||||||
create_label(WIDTH / 2 - 16 * GAME_TITLE.length, HEIGHT / 4, GAME_TITLE, 56);
|
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)
|
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);
|
create_start_overlay(GAME_TITLE);
|
||||||
music_played = true;
|
music_played = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ function setup_game() {
|
|||||||
loadSprite("pumpkin", "/static/graphics/pumpkin.png");
|
loadSprite("pumpkin", "/static/graphics/pumpkin.png");
|
||||||
|
|
||||||
scene("game", (difficulty, pumpkin_array, revealed, found_pairs, start) => {
|
scene("game", (difficulty, pumpkin_array, revealed, found_pairs, start) => {
|
||||||
|
if (localStorage.getItem("Pumpkin Memory Jumpscares") == "true") {
|
||||||
|
if (Math.random() < 0.1) {
|
||||||
|
jumpscare();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let cols;
|
let cols;
|
||||||
switch (difficulty) {
|
switch (difficulty) {
|
||||||
case "easy": pumpkin_pairs = 5; cols = 5; break;
|
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 best_time = Number(localStorage.getItem("pumpkin_memory_best_time")) || 99999;
|
||||||
let first_time = 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 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_label = create_label(400, 5, `Time spent: ${(elapsed / 1000).toFixed(1)}s Best Time: ${best_time_display}`);
|
||||||
|
|
||||||
const timer_interval_id = setInterval(() => {
|
const timer_interval_id = setInterval(() => {
|
||||||
@@ -89,7 +95,7 @@ function setup_game() {
|
|||||||
let jumpscare_interval_id;
|
let jumpscare_interval_id;
|
||||||
if (localStorage.getItem("Pumpkin Memory Jumpscares") == "true") {
|
if (localStorage.getItem("Pumpkin Memory Jumpscares") == "true") {
|
||||||
jumpscare_interval_id = setInterval(() => {
|
jumpscare_interval_id = setInterval(() => {
|
||||||
if (Math.random() < 0.035) {
|
if (Math.random() < 0.05) {
|
||||||
jumpscare();
|
jumpscare();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -111,7 +117,7 @@ function setup_game() {
|
|||||||
}
|
}
|
||||||
localStorage.setItem(`memory_best_${difficulty}`, best_time);
|
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);
|
create_label(520, 320, `You win!\nTime took: ${(elapsed / 1000).toFixed(1)} s\nBest Time: ${best_time_display}`, 48);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,10 @@ function setup_game() {
|
|||||||
destroy(enemy);
|
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);
|
create_label(520, 320, `Game Over!\nScore: ${Math.floor(score)}\nHigh Score: ${high_score}`, 48);
|
||||||
|
|
||||||
if (localStorage.getItem("Pumpkin Roll Jumpscares") == "true") {
|
if (localStorage.getItem("Pumpkin Roll Jumpscares") == "true") {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ function setup_game() {
|
|||||||
let jumpscare_interval_id;
|
let jumpscare_interval_id;
|
||||||
if (localStorage.getItem("Whack a Pumpkin Jumpscares") == "true") {
|
if (localStorage.getItem("Whack a Pumpkin Jumpscares") == "true") {
|
||||||
jumpscare_interval_id = setInterval(() => {
|
jumpscare_interval_id = setInterval(() => {
|
||||||
if (Math.random() < 0.035) {
|
if (Math.random() < 0.05) {
|
||||||
jumpscare();
|
jumpscare();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -100,7 +100,12 @@ function setup_game() {
|
|||||||
|
|
||||||
onClick("pumpkin", (pumpkin) => {
|
onClick("pumpkin", (pumpkin) => {
|
||||||
destroy(pumpkin);
|
destroy(pumpkin);
|
||||||
|
if (localStorage.getItem("Whack a Pumpkin Jumpscares") == "true") {
|
||||||
|
if (Math.random() < 0.1) {
|
||||||
|
jumpscare();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
score += 1;
|
score += 1;
|
||||||
if (score > high_score) {
|
if (score > high_score) {
|
||||||
high_score = score;
|
high_score = score;
|
||||||
|
|||||||
Reference in New Issue
Block a user