From e3939d41322a5ddd788fe6e1f370a3c0cd6474f0 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 3 May 2025 14:14:06 +0700 Subject: [PATCH] feat: update story --- README.md | 46 ++++++++++++++++++++-------------------- plan/NNTV.md | 2 +- src/game/locales/en.json | 12 +++++------ src/game/locales/vi.json | 8 +++---- src/game/scenes/Game.js | 8 +++---- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c6046a0..a7c1985 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Stealth Grid - A Turn-Based Stealth Game +# Night Ninja: Twilight Voyage -Stealth Grid is a turn-based stealth puzzle game where you navigate through a grid-based environment while avoiding detection by various types of guards. Your goal is to reach the exit point in each level without being caught. +Night Ninja: Twilight Voyage is a turn-based stealth puzzle game where you play as a ninja rabbit navigating through a grid-based environment while avoiding detection by various vegetable guards. Your goal is to rescue the missing carrot princess of the vegetable kingdom. ## Game Overview -In Stealth Grid, you play as a stealthy character trying to navigate through increasingly complex levels. Each level consists of a grid where: +In Night Ninja: Twilight Voyage, you play as a ninja rabbit trying to navigate through increasingly complex levels in the vegetable kingdom to rescue the missing carrot princess. Each level consists of a grid where: - You must move from your starting position to the green goal cell - Gray cells represent walls that block movement @@ -14,12 +14,12 @@ In Stealth Grid, you play as a stealthy character trying to navigate through inc ## Game Features -- **Turn-based gameplay**: Each move you make triggers the guards to take their turn +- **Turn-based gameplay**: Each move you make triggers the vegetable guards to take their turn - **Multiple guard types**: - - Static Guards (red): Light up fixed cells around them - - Rotating Guards (blue): Rotate and light up cells in different directions each turn - - Blinking Guards (yellow): Toggle their lights on and off each turn - - Patrolling Guards (purple): Move along predefined paths, lighting cells around them + - Static Vegetable Guards (red): Light up fixed cells around them + - Rotating Vegetable Guards (blue): Rotate and light up cells in different directions each turn + - Blinking Vegetable Guards (yellow): Toggle their lights on and off each turn + - Patrolling Pest Bugs (purple): Move along predefined paths, lighting cells around them - **Progressive difficulty**: 12 levels with increasing complexity and new mechanics - **Grid-based movement**: Move one cell at a time using arrow keys or by clicking adjacent cells - **Stealth mechanics**: Avoid lit cells to remain undetected @@ -38,15 +38,15 @@ This game is built with: ## How to Play -- Use **arrow keys** to move your character one cell at a time +- Use **arrow keys** to move your rabbit character one cell at a time - Alternatively, **click** on an adjacent cell to move there -- Reach the **green goal cell** to complete each level +- Reach the **green goal cell** to complete each level and progress in your quest to rescue the missing carrot princess - Avoid stepping on **yellow lit cells** or you'll be detected and lose a life -- Plan your moves carefully as each guard behaves differently: - - **Red guards** (Static): Always light the same cells - - **Blue guards** (Rotating): Change the direction they light each turn - - **Yellow guards** (Blinking): Turn their lights on and off each turn - - **Purple guards** (Patrolling): Move along a path, lighting cells around them +- Plan your moves carefully as each vegetable guard behaves differently: + - **Red vegetable guards** (Static): Always light the same cells + - **Blue vegetable guards** (Rotating): Change the direction they light each turn + - **Yellow vegetable guards** (Blinking): Turn their lights on and off each turn + - **Purple pest bugs** (Patrolling): Move along a path, lighting cells around them ## Available Commands @@ -124,19 +124,19 @@ If you want to customize your build, such as adding plugin (i.e. for loading CSS The game is built with a modular architecture: - **Grid System**: Manages the game grid, walls, goals, and lighting -- **Player**: Handles player movement and detection -- **Guards**: Different types of guards with unique behaviors +- **Player**: Handles the rabbit character's movement and detection +- **Vegetable Guards**: Different types of vegetable guards with unique behaviors - **Turn Manager**: Controls the turn-based gameplay -- **Lighting System**: Manages which cells are lit by guards -- **Level Manager**: Loads level data and sets up the game environment +- **Lighting System**: Manages which cells are lit by vegetable guards +- **Level Manager**: Loads level data and sets up the vegetable kingdom environment ## Future Enhancements Potential features for future development: -- Additional guard types with new behaviors -- Power-ups that provide temporary abilities -- Level editor for creating custom levels +- Additional vegetable guard types with new behaviors +- Vegetable power-ups that provide temporary abilities +- Level editor for creating custom vegetable kingdom levels - High score system - Sound effects and background music - Mobile-friendly controls @@ -149,7 +149,7 @@ This game was built using the Phaser 3 Vite template. The template includes a lo - Built with [Phaser 3](https://phaser.io) - Developed as a turn-based stealth puzzle game -- Inspired by classic stealth games +- Inspired by classic stealth games and vegetable kingdom stories --- diff --git a/plan/NNTV.md b/plan/NNTV.md index 6bad106..ee13a6b 100644 --- a/plan/NNTV.md +++ b/plan/NNTV.md @@ -22,7 +22,7 @@ Night Ninja: Twilight Voyage là một game giải đố theo lượt dựa trê ## 2. THIẾT KẾ GAME ### Cốt truyện -Công chúa Tỳ Vương của xứ sở cà rốt đã bị bắt cóc. Người chơi hóa thân thành ninja thỏ, vượt qua các màn để giải cứu công chúa. Tuy nhiên, ở màn cuối cùng, người chơi không thể tiếp cận công chúa vì toàn bộ bản đồ sẽ bật sáng khi đến gần, và game kết thúc với thông báo "Thật tiếc, kiếp này ninja không thể giải cứu công chúa rồi." +Công chúa cà rốt của vương quốc rau củ quả bị mất tích. Người chơi hóa thân thành ninja thỏ, vượt qua các màn để giải cứu công chúa. Tuy nhiên, ở màn cuối cùng, người chơi không thể tiếp cận công chúa vì toàn bộ bản đồ sẽ bật sáng khi đến gần, và game kết thúc với thông báo "Thật tiếc, kiếp này ninja không thể giải cứu công chúa rồi." ### Gameplay - **Mục tiêu chính**: Vượt qua 12 màn chơi để tiếp cận công chúa diff --git a/src/game/locales/en.json b/src/game/locales/en.json index 088776b..e646411 100644 --- a/src/game/locales/en.json +++ b/src/game/locales/en.json @@ -1,10 +1,10 @@ { - "gameTitle": "Night Ninja: Twilight Voyage (NNTV)", + "gameTitle": "Night Ninja: Twilight Voyage", "startGame": "START GAME", "levelSelect": "LEVEL SELECT", "settings": "SETTINGS", "guide": "GUIDE", - "gameDescription": "Guide the ninja through the shadows.\nAvoid light at all costs.\nRescue the princess... if you can.", + "gameDescription": "Guide the ninja rabbit through the shadows.\nAvoid light at all costs.\nRescue the missing carrot princess of the vegetable kingdom... if you can.", "instructions": "Use arrow keys or WASD to move.", "languageSettings": "Language", "english": "English", @@ -21,18 +21,18 @@ "restartLevel": "RESTART LEVEL", "detected": "You have been detected!", "playAgain": "PLAY AGAIN", - "princessDetected": "The princess has detected the ninja! The entire palace is lit up!", + "princessDetected": "The missing carrot princess has detected you! The entire vegetable palace is lit up!", "gameOver": "GAME OVER", "theEnd": "THE END", "caughtInLight": "You were caught in the light!", - "ninjaFailed": "Unfortunately, in this life, the ninja cannot rescue the princess.", + "ninjaFailed": "Unfortunately, in this life, you cannot rescue the missing carrot princess of the vegetable kingdom.", "tryAgain": "TRY AGAIN", "mainMenu": "MAIN MENU", "guideTitle": "GAME GUIDE", "levelObjectives": "LEVEL OBJECTIVES", - "levelObjectivesContent": "- Level 1: Navigate through the garden while avoiding guards and lights.\n- Level 2: Infiltrate the palace outer walls and find the secret entrance.\n- Level 3: Move through the palace corridors to reach the princess's chamber.\n- Level 4: Rescue the princess and escape through the secret passage.", + "levelObjectivesContent": "- Level 1: Navigate through the vegetable garden while avoiding guards and lights.\n- Level 2: Infiltrate the vegetable palace outer walls and find the secret entrance.\n- Level 3: Move through the palace corridors to reach the missing carrot princess's chamber.\n- Level 4: Rescue the missing carrot princess and escape through the secret passage.", "movementControls": "MOVEMENT CONTROLS", "movementControlsContent": "- Arrow Keys: Move in four directions\n- WASD Keys: Alternative movement controls\n- Space/Enter: Interact with objects", "enemyTypes": "ENEMY TYPES", - "enemyTypesContent": "- Guards: Patrol fixed routes. Avoid their line of sight.\n- Searchlights: Moving light sources that will detect you if you're caught in them.\n- Dogs: Can detect you even in darkness if you get too close.\n- Traps: Hidden dangers that can end your mission instantly." + "enemyTypesContent": "- Vegetable Guards: Patrol fixed routes. Avoid their line of sight.\n- Searchlights: Moving light sources that will detect you if you're caught in them.\n- Pest Bugs: Can detect you even in darkness if you get too close.\n- Traps: Hidden dangers that can end your mission instantly." } diff --git a/src/game/locales/vi.json b/src/game/locales/vi.json index 4ebe1f3..b8e7f8b 100644 --- a/src/game/locales/vi.json +++ b/src/game/locales/vi.json @@ -4,7 +4,7 @@ "levelSelect": "CHỌN CẤP ĐỘ", "settings": "CÀI ĐẶT", "guide": "HƯỚNG DẪN", - "gameDescription": "Dẫn dắt ninja qua bóng tối.\nTránh ánh sáng bằng mọi giá.\nCứu công chúa... nếu bạn có thể.", + "gameDescription": "Dẫn dắt ninja thỏ qua bóng tối.\nTránh ánh sáng bằng mọi giá.\nCứu công chúa cà rốt của vương quốc rau củ quả bị mất tích... nếu bạn có thể.", "instructions": "Sử dụng phím mũi tên hoặc WASD để di chuyển.", "languageSettings": "Ngôn ngữ", "english": "Tiếng Anh", @@ -21,16 +21,16 @@ "restartLevel": "CHƠI LẠI CẤP ĐỘ", "detected": "Bạn đã bị phát hiện!", "playAgain": "CHƠI LẠI", - "princessDetected": "Công chúa phát hiện ra ninja! Toàn bộ cung điện sáng đèn!", + "princessDetected": "Công chúa cà rốt bị mất tích phát hiện ra ninja thỏ! Toàn bộ cung điện sáng đèn!", "gameOver": "GAME KẾT THÚC", "theEnd": "KẾT THÚC", "caughtInLight": "Bạn đã bị bắt trong ánh sáng!", - "ninjaFailed": "Thật tiếc, kiếp này ninja không thể giải cứu công chúa rồi.", + "ninjaFailed": "Thật tiếc, kiếp này ninja thỏ không thể giải cứu công chúa cà rốt bị mất tích rồi.", "tryAgain": "THỬ LẠI", "mainMenu": "MENU CHÍNH", "guideTitle": "HƯỚNG DẪN GAME", "levelObjectives": "MỤC TIÊU CÁC CẤP ĐỘ", - "levelObjectivesContent": "- Cấp độ 1: Di chuyển qua khu vườn trong khi tránh lính canh và ánh sáng.\n- Cấp độ 2: Xâm nhập vào tường ngoài của cung điện và tìm lối vào bí mật.\n- Cấp độ 3: Di chuyển qua các hành lang cung điện để đến phòng của công chúa.\n- Cấp độ 4: Giải cứu công chúa và thoát qua lối đi bí mật.", + "levelObjectivesContent": "- Cấp độ 1: Di chuyển qua khu vườn trong khi tránh lính canh và ánh sáng.\n- Cấp độ 2: Xâm nhập vào tường ngoài của cung điện và tìm lối vào bí mật.\n- Cấp độ 3: Di chuyển qua các hành lang cung điện để đến phòng của công chúa cà rốt bị mất tích.\n- Cấp độ 4: Giải cứu công chúa cà rốt bị mất tích và thoát qua lối đi bí mật.", "movementControls": "ĐIỀU KHIỂN DI CHUYỂN", "movementControlsContent": "- Phím mũi tên: Di chuyển theo bốn hướng\n- Phím WASD: Điều khiển di chuyển thay thế\n- Phím Space/Enter: Tương tác với các vật thể", "enemyTypes": "CÁC LOẠI KẺ ĐỊCH", diff --git a/src/game/scenes/Game.js b/src/game/scenes/Game.js index 3377487..31dfcbc 100644 --- a/src/game/scenes/Game.js +++ b/src/game/scenes/Game.js @@ -555,16 +555,16 @@ export class Game extends Phaser.Scene { checkFinalLevelCondition() { if (!this.isFinalLevel) return false; - // Kiểm tra xem người chơi có đang ở gần công chúa không + // Kiểm tra xem người chơi có đang ở gần công chúa cà rốt bị mất tích không const playerRow = this.player.row; const playerCol = this.player.col; - const goalRow = 9; // Vị trí công chúa ở màn cuối (row 9, col 9) + const goalRow = 9; // Vị trí công chúa cà rốt ở màn cuối (row 9, col 9) const goalCol = 9; - // Tính khoảng cách Manhattan từ người chơi đến công chúa + // Tính khoảng cách Manhattan từ người chơi đến công chúa cà rốt const distance = Math.abs(playerRow - goalRow) + Math.abs(playerCol - goalCol); - // Nếu người chơi đến gần công chúa (khoảng cách <= 2), kích hoạt cơ chế đặc biệt + // Nếu ninja thỏ đến gần công chúa cà rốt (khoảng cách <= 2), kích hoạt cơ chế đặc biệt if (distance <= 2) { // Bật sáng toàn bộ bản đồ this.lightUpEntireMap();