A browser-based Chinese Checkers game built with Vite + Svelte + TypeScript, featuring a skeuomorphic visual style with wooden board and glass marble pieces.
# Clone the repository
git clone https://github.com/zym9863/chinese-checkers.git
cd chinese-checkers
# Install dependencies
pnpm install
# Start development server
pnpm dev
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm preview |
Preview production build |
pnpm check |
Type check with svelte-check |
pnpm test |
Run tests |
pnpm test:watch |
Run tests in watch mode |
Chinese Checkers is a strategy board game where the objective is to move all your pieces from your starting triangle to the opposite triangle.
The first player to move all 10 pieces to the opposite triangle wins.
| Players | Starting Positions |
|---|---|
| 2 | Opposite corners (top/bottom) |
| 3 | Alternating corners |
| 4 | Two pairs of opposite corners |
| 6 | All corners |
src/
├── App.svelte # Main app container
├── components/
│ ├── MenuScreen.svelte # Start screen (player count, mode selection)
│ ├── GameScreen.svelte # Main game interface
│ ├── BoardCanvas.svelte # Canvas board rendering
│ ├── PlayerInfo.svelte # Player info sidebar
│ ├── GameControls.svelte # Undo/restart controls
│ └── GameOverModal.svelte# Game over dialog
└── lib/
├── board.ts # Board generation and utilities
├── rules.ts # Game rules and move validation
├── ai.ts # AI engine (Minimax + Alpha-Beta)
├── renderer.ts # Canvas rendering logic
├── stores.ts # Svelte stores for state management
└── types.ts # TypeScript type definitions
The board uses cube coordinates (q, r, s) where q + r + s = 0:
pnpm check
# Run once
pnpm test
# Watch mode
pnpm test:watch
pnpm build
The built files will be in the dist/ directory.
VS Code with the Svelte extension is recommended.
MIT