@@ -14482,7 +14483,7 @@ ${vpnBadgeTopo}
window.switchEasterEggGame = function (gameName) {
currentEasterEggGame = gameName;
- const validGames = ['tetris', 'dino', 'zipline', 'demineur', 'pacman', 'spaceinvaders'];
+ const validGames = ['tetris', 'dino', 'zipline', 'demineur', 'pacman', 'spaceinvaders', '2048'];
if (!validGames.includes(gameName)) gameName = 'tetris';
document.querySelectorAll('.game-switch-btn').forEach(btn => {
@@ -14532,6 +14533,7 @@ ${vpnBadgeTopo}
if (g === 'demineur' || g === 'minesweeper' || g === 'mine' || g === 'mines') return 'demineur';
if (g === 'pacman' || g === 'pac-man' || g === 'pac') return 'pacman';
if (g === 'spaceinvaders' || g === 'space-invaders' || g === 'space' || g === 'invaders' || g === 'invader') return 'spaceinvaders';
+ if (g === '2048' || g === 'tuiles' || g === 'tiles') return '2048';
if (g === 'tetris' || g === 'brique' || g === 'bricks' || g === '') return 'tetris';
return 'tetris';
}
diff --git a/jeux/2048.html b/jeux/2048.html
new file mode 100644
index 0000000..bdc22e3
--- /dev/null
+++ b/jeux/2048.html
@@ -0,0 +1,881 @@
+
+
+
+
+
+
2048 - AP Manageur Arcade
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Game Over !
+
Plus aucun mouvement possible.
+
+
+
+
+
+
+
+
+ Utilisez les touches ⬆️ ⬇️ ⬅️ ➡️ ou glissez pour déplacer les tuiles. Deux tuiles identiques fusionnent en une seule !
+
+
+
+
+
+
diff --git a/jeux/demineur.html b/jeux/demineur.html
index a73db86..5705221 100644
--- a/jeux/demineur.html
+++ b/jeux/demineur.html
@@ -340,6 +340,23 @@
const urlParams = new URLSearchParams(window.location.search);
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
+ // Game variables & state (declared early to prevent TDZ errors)
+ const CONFIGS = {
+ easy: { cols: 9, rows: 9, mines: 10 },
+ medium: { cols: 16, rows: 16, mines: 40 },
+ hard: { cols: 30, rows: 16, mines: 99 }
+ };
+
+ let cols = 16, rows = 16, totalMines = 40;
+ let board = [];
+ let isGameOver = false;
+ let isGameWon = false;
+ let firstClick = true;
+ let flagsPlaced = 0;
+ let timer = 0;
+ let timerId = null;
+ let isFlagMode = false;
+
const I18N_MINE = {
fr: {
opt_easy: "Débutant (9×9, 10 mines)",
@@ -437,23 +454,6 @@
} catch (e) {}
}
- // Game variables
- const CONFIGS = {
- easy: { cols: 9, rows: 9, mines: 10 },
- medium: { cols: 16, rows: 16, mines: 40 },
- hard: { cols: 30, rows: 16, mines: 99 }
- };
-
- let cols = 16, rows = 16, totalMines = 40;
- let board = [];
- let isGameOver = false;
- let isGameWon = false;
- let firstClick = true;
- let flagsPlaced = 0;
- let timer = 0;
- let timerId = null;
- let isFlagMode = false;
-
function toggleFlagMode() {
isFlagMode = !isFlagMode;
const btn = document.getElementById('flagModeBtn');
diff --git a/jeux/tetris.html b/jeux/tetris.html
index 7fe466d..6bcce3c 100644
--- a/jeux/tetris.html
+++ b/jeux/tetris.html
@@ -339,6 +339,11 @@
const urlParams = new URLSearchParams(window.location.search);
setTheme(urlParams.get('theme') || 'dark', urlParams.get('macosMode'));
+ // Global Game State (declared before applyTetrisLang to avoid TDZ errors)
+ let isMusicEnabled = true;
+ let isPaused = false;
+ let isGameOver = false;
+
const I18N_TETRIS = {
fr: {
next: "Prochaine",
@@ -402,8 +407,8 @@
if (ls) ls.textContent = dict.score;
if (ll) ll.textContent = dict.lines;
if (lv) lv.textContent = dict.level;
- if (pb) pb.textContent = (typeof isPaused !== 'undefined' && isPaused) ? dict.resume : dict.pause;
- if (mb) mb.textContent = (typeof isMusicEnabled !== 'undefined' && !isMusicEnabled) ? dict.music_off : dict.music_on;
+ if (pb) pb.textContent = isPaused ? dict.resume : dict.pause;
+ if (mb) mb.textContent = !isMusicEnabled ? dict.music_off : dict.music_on;
if (nb) nb.textContent = dict.new_game;
if (rb) rb.textContent = dict.replay;
if (cm) cm.innerHTML = dict.cmd_move;
@@ -474,7 +479,6 @@
}
// Tetris Theme Music (Korobeiniki 8-bit Chiptune)
- let isMusicEnabled = true;
let musicTimeout = null;
let musicStep = 0;
const T_TEMPO = 146;
@@ -671,11 +675,9 @@
level: 1
};
let nextPiece = null;
- let isPaused = false;
- let isGameOver = false;
- let dropCounter = 0;
- let dropInterval = 1000;
- let lastTime = 0;
+ dropCounter = 0;
+ dropInterval = 1000;
+ lastTime = 0;
function createMatrix(w, h) {
const m = [];