A strategy game where 2 players compete against each other by interacting with a dynamically updating graph.
Contributors:
Annie Zeng: Developed core game algorithms, game state management, and random graph generator.
Ethan Zhang: Provided testing and validation for game algorithms.
Roy Zhao: Developed core react frontend and dynamic visualizations.
The Paintability Game is a strategic, turn-based two-player game played on a graph, where the players take on the roles of βGoodβ (Law Enforcement) and βEvilβ (Mastermind). The game revolves around preventing or enabling criminal activities at the vertices of the graph.
- Evil Mastermind: Chooses vertices (represented by fortresses) to attack on every turn.
- Police Enforcement: Selects vertices to defend every turn, with the restriction that no two connected vertices can be protected together in the same turn.
Evil Mastermind wins if any vertex's health reaches zero, while Law Enforcement wins if all vertices are defended.
This game ties significantly to graph theory concepts such as list coloring and chromatic numbers. It offers an interactive and engaging way for players to explore these concepts while learning about graph properties.
This tutorial is also provided on the game page to familiarize you with the rules and see how the game connects to graph properties like chromatic numbers and list coloring.
The defender responds by protecting the attacked vertices. However, if two vertices share an edge, the defender can only protect one of them.
Any unprotected vertex at the end of the turn loses 1 health. Any successfully protected vertex cannot be attacked again.
The attacker wins if any vertex has been reduced to zero health. The defender wins if all vertices are safe.
- Interactive Gameplay: Players click on graph vertices to make moves.
- Graph Selection: Custom or randomly generated graphs.
- Tutorial & Instruction: Learn game mechanics and graph theory concepts as they relate to list coloring and chromatic numbers.
- Technology: TypeScript
- Functionality:
- Store game state, advance turns, and determine winners.
- Generate and manage random graphs.
- Technology: React, TypeScript
- Functionality:
- Visualize the game graph and update the game state based on user interactions.
- Accept user input to render nodes accordingly (e.g., targeted, defended).
- Provide real-time feedback and updates during gameplay.
Follow these steps to deploy the app on your machine using Docker:
- Make sure you have Docker installed on your machine. You can download it from Docker's official website.
git clone https://github.com/JiaqiZhao2004/The-Paintability-Game
cd frontend-react
Run the following command to build the Docker image:
docker build -t paintability-game .
Run the app in a Docker container by exposing the appropriate port (e.g., 5173
):
docker run -p 5173:5173 paintability-game
Open your browser and navigate to:
http://localhost:5173
You should see the app running!
- If you want to run the app with a custom port, replace
-p 5173:5173
with your desired port mapping (e.g.,-p 8080:5173
).