This is a web-based Snake and Ladder game developed using React.js, now supporting 2–4 player gameplay (with bots or friends), a backend for game state, and a polished, responsive UI.
- Play with Bot (2–4 players, bots auto-play)
- Play with Friend (2–4 players, enter names/colors)
- Animated player tokens, colored outlines, and card-like HUD
- Turn-based logic, bot automation, and dice roll
- Backend (Express) for game creation and state
- Sound effects (click)
- Fully responsive and accessible design
- React.js (component-based UI)
- Express.js (backend API)
- Tailwind CSS + custom CSS
- JavaScript (ES6+)
- HTML5
src/components/MainNavbar.jsx
— Top navigation barsrc/components/GameScreen.jsx
— Main game board and controlssrc/components/PlayerToken.jsx
— Player token with animationsrc/components/PlayerSetupModal.jsx
— Modal for player count/name/colorsrc/context/GameContext.jsx
— Game state, turn, dice, bot logicsrc/styles/navbar.css
— Navbar stylessrc/styles/game.css
— Board, token, HUD, responsive stylessrc/assets/players/red.png
,blue.png
,green.png
,black.png
— Player tokenssrc/assets/sounds/click.mp3
— Sound effectserver/index.js
— Express backendpackage.json
— Backend scripts and dependencies
- Install dependencies:
npm install
- Start the backend server (port 4000):
npm run start:server
Troubleshooting:
- If you see an error about
require
not defined, make sure you are using Node.js v16+ and thatserver/index.js
uses onlyimport
(notrequire
). - If you see an error about
npm start
not found, usenpm run dev
to start the frontend (Vite default).
- If you see an error about
- In a new terminal, start the frontend:
npm run dev
- Open your browser at http://localhost:5173
- Click Play with Bot: game starts, tokens placed, bots auto-play
- Click Play with Friend: modal for 2–4 players, then name/color entry, then game starts
- Turn order cycles, current player glows
- Tokens use red, blue, green, black PNGs (no duplicates)
- Responsive: tokens/HUD do not overlap on small screens
- Backend logs game creation and state requests
- Play/Reset buttons work
- Player name/color entry modal is basic (can be improved for validation)
- No persistent backend (in-memory only)
- No full board logic (just demo token movement)
- Sound effects are minimal (add more for dice, win, etc.)
- Each commit is self-contained with a one-line message.
- Final commit:
chore: finish game MVP - navbar, setup, tokens and backend
Branch: feature/game-play-2to4