3.1 KiB
3.1 KiB
HanjaKanaMun - Project Plan
Overview
Odin + raylib multilingual memory card game for learning Japanese (Hiragana/Katakana), Korean (Hangul), and Thai scripts.
Current Status
Completed
- Created AGENTS.md project plan
- Created src/ directory structure with subdirectories (themes, card, memory, screens, assets)
- Separated themes into themes/themes.odin (colors, constants)
- Separated card logic into card/card.odin (Card struct, rendering, click detection)
- Separated memory game into memory/memory.odin (game state, logic)
- Separated screens into screens/screens.odin (UI screens, buttons)
- Added font loading in assets/assets.odin
- Fixed card positioning (removed -40 offset that pushed cards off screen)
- Fixed card selection (now allows selection in both WAITING and FIRST states)
- Added flip animations for cards (visual feedback when flipping)
- Improved visual styling (rounded corners, theme colors)
In Progress
- Fix Japanese font rendering (TTF loading fails in raylib with "Failed to process TTF font data")
Pending
- Add keyboard support for card selection (1-9, A-L, etc.)
- Add proper Japanese font that works with raylib
- Add Korean and Thai language support
- Add more animations (win screen, transitions)
- Add sound effects
- Add score tracking and high scores
- Add difficulty levels
- Test all changes work together
Known Issues
- Font rendering: Japanese characters show as "?" - raylib's TTF loader fails with CJK fonts. Current workaround: using default font with romanji characters (A, I, U, etc.)
- Keyboard support: Not yet implemented
File Structure
HanjaKanaMun/
├── AGENTS.md # Project plan (this file)
├── README.md # Project overview
├── odin.json # Odin config
├── main.odin # Entry point only
├── src/
│ ├── themes/
│ │ └── themes.odin # Color themes, styling constants
│ ├── card/
│ │ └── card.odin # Card struct and rendering
│ ├── memory/
│ │ └── memory.odin # Memory game logic
│ ├── screens/
│ │ └── screens.odin # Screen management (main menu, language screens)
│ └── assets/
│ └── assets.odin # Font loading, resource management
└── assets/ # Font files, images (future)
└── DroidSansJapanese.ttf
Next Steps
-
Font rendering: Try alternative approaches:
- Use raylib's LoadFontFromImage to create font from bitmap
- Use pre-converted font files
- Use system fonts via platform-specific APIs
- Use a different font format that raylib supports
-
Keyboard support: Add number/letter keys to select cards
-
Testing: Verify all current changes work together
Notes
- NO rm -rf or starting over
- Make small, incremental changes
- Test after each change
- Keep existing functionality working
- All code is now properly separated into modules
- Game is playable with mouse (romanji characters display correctly)