This is a web-based, cross-platform mobile game for Android and iOS, built with interactive gameplay. The game is developed using HTML, CSS, and vanilla JavaScript, making it lightweight and easy to package for mobile platforms using tools like Cordova or Capacitor.
- Cross-Platform: Play on any device with a modern web browser, or package it as a native app for Android and iOS.
- Multiplayer Support: Supports up to 4 players on the same device.
- Interactive Gameplay: Engage in a dynamic and strategic battle for board dominance.
- Visually Engaging Animations: Smooth animations for circle division and other game events.
- Sequential Division: Trigger cascading chain reactions to take over the board.
- Theme Toggle: Switch between a green theme and a dark mode.
- Responsive Design: The game is designed to be responsive and playable on different screen sizes.
- Select Number of Players: Choose between 2, 3, or 4 players.
- Initial Placement: At the start of the game, each player selects a designated "box" on the game board. The initial circle placed in this box will begin with 3 "power" (pow).
- Adding Power: On your turn, you can only add power to your own circles. Click on one of your circles to add 1 power to it.
- Circle Division: When a circle accumulates 4 power, it divides into 4 new circles, each with 1 power. The original box from which the division occurred will become empty.
- Circle Conversion: If a player's circle is hit by an opponent's circle, it converts to the opponent's color. If the converted circle has 3 power, it immediately divides according to the opponent's circle division logic.
- Sequential Division: A sequential division mechanism is implemented. After an initial circle divides, any adjacent circles that subsequently reach 4 power will divide in a cascading sequence.
- A player is eliminated when they have no circles left on the board.
- The last player with circles on the board wins the game.
- Turn Indicator: The current player's turn is clearly displayed.
- Winner Display: The winner is displayed at the end of the game.
- Theme Toggle: A theme toggle is available to switch between a green theme and a dark mode.
- Mouse/Touch: Click or tap on a cell to perform an action.
To run the game locally, you need to serve the files using a local web server.
-
Clone or download the repository.
-
Navigate to the
color_war_webdirectory in your terminal. -
Start a simple Python HTTP server:
python -m http.server
-
Open your web browser and go to
http://localhost:8000.
- HTML5
- CSS3
- JavaScript (ES6+)
- Font Awesome (for icons)
To package this web application as a native mobile app for Android and iOS, you can use a wrapper like Apache Cordova or Capacitor.
-
Install Capacitor:
npm install @capacitor/core @capacitor/cli
-
Initialize Capacitor:
npx cap init "Color War" "com.example.colorwar" --web-dir "public"
-
Add Mobile Platforms:
npx cap add android npx cap add ios
-
Sync and Build:
npx cap sync npx cap open android npx cap open ios
This will open the native projects in Android Studio and Xcode, where you can build and run the app on emulators or physical devices.
This project is licensed under the GNU General Public License v3.0 License - see the LICENSE file for details.