From df95c314000d9dde13e6de471885147497e2c20c Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Sat, 30 Aug 2025 09:45:41 -0600 Subject: [PATCH] `Fix game status assignment in level up logic` The change corrects an assignment operator error in the `levelUp` method where `===` (equality comparison) was used instead of `=` (assignment). This bug would have prevented the game status from being properly set to false when reaching level 25, thus breaking the game end condition. The fix ensures that when the player reaches level 25, the game status is correctly updated and the game end sequence is triggered as intended. --- README.md | 32 ++++++++++++++++++++++++++++++++ src/GameScene.js | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1a8c6a --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# The Jewel Weaver + +## Project Description + +The Jewel Weaver is a match-3 puzzle game built using Phaser 3.90, featuring an engaging gameplay loop where players swap adjacent jewels to create matches of three or more identical jewels. The game includes core mechanics such as jewel swapping, match detection and destruction, cascading jewel movements, and a countdown timer for added challenge. + +The primary objective is to achieve high scores by creating combos and clearing the board efficiently. The game features a visually appealing interface with a black background, grid-based gameplay, and animated jewel interactions. It includes multiple scenes - a menu scene for initial setup and a main game scene with core gameplay mechanics. + +## Technologies Used + +This codebase utilizes: +- **Phaser 3.90**: A powerful HTML5 game framework for creating 2D games in JavaScript +- **JavaScript (ES6+)**: Modern JavaScript features including classes, modules, and async/await patterns +- **HTML5 Canvas**: For rendering the game graphics and animations +- **CSS3**: For styling the web page layout and responsive design + +## File Structure + +``` +. +├── index.html # Main HTML entry point with Phaser script loading +├── src/ +│ ├── main.js # Game configuration and initialization +│ ├── MenuScene.js # Menu scene for initial game setup and UI +│ └── GameScene.js # Core gameplay logic including grid management, jewel swapping, match detection +└── assets/ + └── CodePredators-Regular.otf # Font file used in the game (though not currently implemented) +``` + +The codebase follows a modular structure where each scene is encapsulated in its own class. The main.js file handles game initialization and configuration, while MenuScene and GameScene manage their respective gameplay states. The Phaser framework's scene system allows for seamless transitions between different game states. + +The GameScene contains the core logic including grid management (makeGrid), jewel creation (createJewel), swap mechanics (moveJewel), match detection (checkMatches), and game flow control functions. \ No newline at end of file diff --git a/src/GameScene.js b/src/GameScene.js index 0064534..a969d9e 100644 --- a/src/GameScene.js +++ b/src/GameScene.js @@ -1075,7 +1075,7 @@ export class GameScene extends Phaser.Scene { levelUp() { this.level ++; if (this.level === 25) { - this.gameStatus === false + this.gameStatus = false this.gameEnd(); return; }