This is a simple implementation of a game grid system using JavaScript. The code creates a grid-based game where symbols are randomly placed on the grid, and players can interact by removing connected groups of identical symbols.
- Make sure you have a modern web browser that supports ES6 JavaScript features.
- Clone the repository or download the files.
- Open
index.html
in your web browser.
Alternatively, integrate the provided classes (Coordinates
, GameItem
, Game
) into your existing web application or project to use the game grid system.
To create a game instance, instantiate the Game
class with optional parameters for the number of columns, rows, and the HTML container ID:
const game = new Game(6, 7, "#gameContainer");
- Clicking on Cells: Clicking on non-empty cells in the grid will identify and remove connected groups of identical symbols.
- Adjust the number of columns and rows in the game grid by passing different values to the
Game
class constructor. - Modify the symbols used in the game by changing the
GAME_SYMBOLS
array in the code.
Represents the coordinates of a cell in the game grid.
Represents an element in the game grid, holding a symbol and managing its properties.
Manages the game grid, including grid generation, rendering, interaction, and symbol removal logic.
Contributions are welcome! Feel free to submit issues or pull requests for any enhancements or bug fixes.
This project is licensed under the MIT License.