Hnefatafl is an asymmetric Norse strategy game:
- Blue Team (Defenders) protects the King.
- Red Team (Attackers) attempts to capture the King.
- The King wins by escaping to a corner.
This implementation targets a modern "Tahoe 26" macOS-like visual style with responsive board scaling and configurable themes.
Language: Kotlin 2.1
UI: Compose Multiplatform (Desktop)
Architecture: Shared game logic + shared UI + desktop host
Build: Gradle Kotlin DSL
Quality: ktlint + detekt + unit/integration tests
Packaging: Compose Native Distributions (DMG / EXE / DEB)
CI/CD: GitHub Actions release workflow
- 11x11 board with correct initial spawn layout
- Orthogonal movement (rook-like), no jumping
- Only King may enter corner squares
- Pawn capture by sandwiching (including edge capture rule in this project)
- King escape win: reaches any corner
- Attacker win: king surrounded on 4 sides
- Turn-based flow + undo + match win counters
For players, use packaged releases from GitHub Releases:
- macOS:
.dmg - Windows:
.exe/.msi - Linux:
.deb - Android:
.apk(debug + release-unsigned)
These bundles include required runtime components.
- Open GitHub Releases for this repo.
- Download the installer for your OS.
- Install and launch
Hnefatafl.
./gradlew verify
./gradlew :app-desktop:run# Validate desktop/shared quality gates first
./gradlew verify
# Build Android debug APK
./gradlew :app-android:assembleDebug
# Build Android release APK (unsigned)
./gradlew :app-android:assembleReleaseAPK outputs:
- Debug:
app-android/build/outputs/apk/debug/app-android-debug.apk - Release:
app-android/build/outputs/apk/release/app-android-release-unsigned.apk
Notes:
- Android uses the same gameplay and settings system as desktop.
- Transparent background mode is intentionally hidden on Android.
- Image background mode is available, but image picking is currently disabled on Android host (desktop-only picker for now).
./gradlew :app-desktop:packageDistributionForCurrentOSOutput is generated under:
app-desktop/build/compose/binaries/main/
Tag-based release is configured via GitHub Actions (.github/workflows/release-desktop.yml).
git tag v1.0.0
git push origin v1.0.0This builds platform-native installers and attaches them to the GitHub Release, including Android APK artifacts.
shared/logic— rules engine + testsshared/ui— shared Compose UI + settings systemapp-desktop— desktop window host, native integrations (file/color pickers, window controls)app-android— Android app host activity + APK packaging
Current milestone: v1.0 release candidate
Core gameplay, modern UI, customization, and desktop packaging are in place.