Skip to content

michaelblaess/halma

Repository files navigation

Halma — Chinese Checkers vs AI

English · Deutsch


Stars Forks Issues Pull Requests

Last Commit License React TypeScript

A Chinese Checkers (star halma) board game against AI, playable directly in the browser. Three difficulty levels, seven themes, background music, highscores, and fully offline-capable as a PWA.

Features

  • AI Opponent — Minimax algorithm with three difficulty levels (Easy / Medium / Hard), runs in a Web Worker
  • 7 Themes — Standard, Cosmos, Neon, Elegance, Wood, High-Contrast, Light (auto-detect via prefers-color-scheme)
  • Sound & Music — Generated SFX via Web Audio API, licensed background music with shuffle playlist
  • PWA & Offline — Installable as an app, fully playable offline thanks to Service Worker
  • Speed Timer — Time tracking with tenths of seconds, local highscores per difficulty level
  • Accessibility — ARIA labels, keyboard navigation, focus styles, screen reader support, prefers-reduced-motion
  • Side Selection — Start from top or bottom
  • Player Name — Customizable, stored locally

Tech Stack

Technology Usage
React 19 UI rendering
TypeScript Type safety
Vite 7 Build tool & dev server
CSS Modules + CSS Custom Properties Styling & theming
Web Workers AI computation (non-blocking)
Web Audio API Sound effects
vite-plugin-pwa Service worker & manifest

Development

# Install dependencies
npm install

# Start dev server
npm run dev

# Production build
npm run build

# Preview build
npm run preview

Project Structure

src/
  model/         Types, board setup, game logic
  hooks/         useGame (reducer, timer, highscores)
  components/    Board, GameInfo, DifficultySelect, Piece, ThemeSelect
  theme/         themes.ts (7 themes + tokens), ThemeContext.tsx
  ai/            AI Worker (Minimax algorithm)
  audio/         sounds.ts (SFX), music.ts (background music)
docs/            GitHub Pages landing page
public/
  music/         Licensed MP3 tracks (not in repo, see public/music/README.md)
  HIGHSCORE.md   Highscore table

Music

The three tracks are licensed through AudioJungle (Envato Market) under the Music Standard License. No playable files live in the repository. What is committed are AES-encrypted versions under assets/music/, decrypted at build time with the key from MUSIC_KEY.

Clone the project and you get no music. The game runs fine without it, the music button simply does nothing.

Titles, authors and licence details are in CREDITS.md, the technical side in public/music/README.md.

Disclaimer

Halma is a classic board game invented in 1883 by George Howard Monks. The star halma variant (also known as "Chinese Checkers") was created in 1892. This website is a non-commercial hobby project and is not affiliated with any commercial Halma products or their manufacturers.

License

Apache License 2.0 — see LICENSE.

About

Chinese Checkers (Star Halma) vs AI — play in your browser. Three difficulty levels, seven themes, background music, highscores, and fully offline-capable as a PWA.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages