A Minesweeper game built with React, Pixi.js and Vite. Deployable to Cloudflare Workers.
https://minesweeper.nicktgn.dev/
To run the game locally:
npm install
npm run devTo deploy to Cloudflare Workers:
npm run deployFor visual testing/debugging purposes, you can set the VITE_DEBUG_GRID environment variable to true in .env file to show the second grid with all cells open.
- The first square the user clicks must never be a mine.
- Clicking a mine ends the game and reveals all mines. Clicking a safe square reveals it; if it has adjacent mines, it displays their count; otherwise, it automatically reveals neighboring squares.
- Right clicking (long press on touch screen) on a square puts a flag on it. The flagged square can’t be opened. Pressing flagged square again removes the flag.
- "Chording": if the number in a square is equal to the number of squares touching that square that are flagged, double clicking on the number opens up all remaining squares around the number.
- The game ends when all safe squares are revealed or when a mine is clicked or "chorded"
- UI displays remaining flags to set and elapsed time (in seconds)
- Smiley button resets the game; face changes based on game state
- While pressing (mouse down) on the cell, it shows a preview of which cells would be revealed for both single cell opening and for chording
- Basic game logic
- Basic UI
- Menu screen with difficulty selection
- Deploy to Cloudflare Workers
- Mouse and touch input
- (Bug) Fix press preview visualization (on mouse down) for single cell and for chording
- Better test coverage
- Add CI/CD pipeline
- Add e2e tests
- Add custom difficulty levels
- Add more theming options
- Use media queries to adjust layout for mobile screens as well as landscape orientation
- Keep and display stats across sessions
- Add more polish the UI and create reusable component system
- Add storybook