Add justfile, ols/odinfmt config, tests and Gitea workflows; drop odin.json

- justfile with build/run/check/test/release/package/fmt/clean recipes
- ols.json and odinfmt.json for neovim (ols)
- Tests for memory game rules and card animation; memory.deal and
  memory.select_card split out so logic is testable without a window
- Gitea workflows: build+test on main/develop, package and upload to the
  generic package registry on version branches
- Game changes to the executable's directory so packaged builds find assets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SansanandClaude Opus 5.5 committed 2026-10-01 21:04:08 +02:00
1 parent 148570a4e6
commit 9ee2eabe9a
12 files changed
+428 -23

No files matched your search

+11 -4
View File
@@ -3,7 +3,7 @@
## Overview
Odin + raylib multilingual memory card game for learning Japanese (Hiragana/Katakana), Korean (Hangul), and Thai scripts.
Build and run: `odin run .` (check with `odin check . -vet`)
Commands (see `justfile`): `just run`, `just check`, `just test`, `just package <version>`
## Current Status
@@ -32,14 +32,20 @@ Build and run: `odin run .` (check with `odin check . -vet`)
1. **Font glyphs must be listed**: raylib only bakes the codepoints passed to `LoadFontEx`. Any new non-ASCII text needs its characters added in `assets.build_codepoints`, otherwise it renders as `?`.
2. **Old font failure root cause**: `DroidSansJapanese.ttf` was a GitHub HTML page saved from a blob URL, not a font. Always download fonts from raw URLs and check them with `file`.
3. **Thai shaping**: raylib does no text shaping, so Thai combining vowels/tone marks may be misplaced. Prefer standalone consonants on Thai cards.
4. `odin.json` is not read by the Odin compiler (imports use relative paths); it is only informational.
4. Tests share the memory game's global state, so they must run single-threaded (`just test` sets `ODIN_TEST_THREADS=1`).
5. The game changes directory to the executable's folder at startup so `assets/` is found from anywhere.
## File Structure
```
HanjaKanaMun/
├── AGENTS.md # Project plan (this file)
├── README.md
├── odin.json # Informational only, not used by the compiler
├── justfile # build/run/check/test/package recipes
├── ols.json # ols language server settings (neovim)
├── odinfmt.json # odinfmt formatter settings (4 spaces, LF)
├── .gitea/workflows/
│ ├── gitea-build.yaml # check + test + build on main/develop
│ └── gitea-release.yaml # package on version branches (*.*), upload to Gitea packages
├── main.odin # Window/audio setup, screen state machine
├── src/
│ ├── themes/themes.odin # Theme struct, flag colors, Screen/Flag enums, layout constants
@@ -49,6 +55,7 @@ HanjaKanaMun/
│ ├── card/card.odin # Card struct, flag card-back art, face textures, flip animation
│ ├── memory/memory.odin # Memory game state, logic and drawing
│ └── screens/screens.odin # Main menu and language menus
├── tests/memory_test.odin # Game logic and card animation tests
└── assets/
├── MPLUSRounded1c-Medium.ttf
├── MPLUSRounded1c-ExtraBold.ttf
@@ -58,6 +65,6 @@ HanjaKanaMun/
## Notes
- NO rm -rf or starting over
- Make small, incremental changes
- Test after each change (`odin check . -vet`, then run)
- Test after each change (`just check`, `just test`, then `just run`)
- Keep existing functionality working
- Commit after each working step