Files
SansanandClaude Sonnet 5 ad7d19b85a
Build and Test / build (push) Successful in 22s
Build and Test / windows (push) Successful in 1m8s
Embed fonts into the executable, ship release artifacts as bare binaries
Fonts are now baked in with #load and loaded via LoadFontFromMemory
instead of LoadFontEx reading assets/*.ttf from disk, so a build no
longer needs an assets/ folder next to it at runtime - the chdir to
the executable's own directory in main.odin is dead code, removed.

just package / just package-windows now produce a single executable
(build/<name>_<version>_<os>_<arch>[.exe]) instead of a tar.gz/zip,
and the release workflow's upload/release-asset globs and the lld/zip
toolchain package list are updated to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-03 20:11:47 +02:00

61 lines
2.7 KiB
Markdown

# HanjaKanaMun
Odin + raylib memory card game for learning Japanese, Korean and Thai scripts.
Match each symbol with its reading: hiragana and katakana with romaji, Hangul letters with their
Revised Romanization, and Thai consonants with their sound and name word. Three difficulties
(6, 12 or 16 pairs), best scores per deck, and a card deck themed on each country's flag.
## Controls
| | |
|---|---|
| Mouse | Click cards and buttons |
| Arrows / WASD / hjkl | Move between cards |
| Enter / Space | Flip the selected card (Enter also plays again) |
| 1-3 | Pick a language or deck in menus |
| Left / Right | Change difficulty |
| Esc | Back (quits from the main menu) |
Scores are saved to `profile.json` in the user data folder (`~/Library/Application Support/HanjaKanaMun`
on macOS, `~/.local/share/HanjaKanaMun` on Linux, `%APPDATA%\HanjaKanaMun` on Windows).
## Development
Requires [Odin](https://odin-lang.org) (dev-2026-09) and [just](https://just.systems).
```sh
just run # build and play (debug)
just check # type-check with -vet
just test # run tests
just package 1.0 # native release build -> build/HanjaKanaMun_1.0_<os>_<arch> (self-contained executable)
just windows-deps # Linux only: fetch Windows SDK/CRT (xwin) and raylib.lib
just package-windows 1.0 # cross-compiled Windows build -> build/HanjaKanaMun_1.0_windows_x86_64.exe
```
The Windows build needs `lld-link`. On macOS, `brew install lld` and set `LLD_LINK`, and point `XWIN_SDK` and
`RAYLIB_WINDOWS` at an xwin splat and Odin's Windows `vendor/raylib/windows` folder (the Linux/macOS Odin releases
don't include `raylib.lib`).
### Neovim
`ols.json` and `odinfmt.json` configure the [ols](https://github.com/DanielGavin/ols) language server and formatter.
Install ols (e.g. `:MasonInstall ols`) and enable it with nvim-lspconfig: `vim.lsp.enable('ols')`.
Formatting goes through ols (`vim.lsp.buf.format()`), or `just fmt` if `odinfmt` is on your PATH.
## CI
- `.gitea/workflows/gitea-build.yaml`: check, test and build on pushes and PRs to `main` and `develop`, plus a
Windows cross-build so link problems show up before a release.
- `.gitea/workflows/gitea-release.yaml`: on a version tag like `v1.0`, builds Linux and Windows packages, uploads them
to the Gitea generic package registry (`HanjaKanaMun/1.0`) and creates a Gitea release with both attached.
Needs a `TOKEN` secret with package write access.
- `.gitea/actions/setup`: shared toolchain setup (apt packages, Odin, just).
Release: `git tag v1.0 && git push origin v1.0`
## Credits
Fonts, all under the SIL Open Font License (license files in `assets/`):
M PLUS Rounded 1c (UI and kana), Jua (Hangul), Mali (Thai).