Restructure into themed screens with flag card backs, real font, flip animation and sound

- Replace the bogus DroidSansJapanese.ttf (an HTML page) with M PLUS Rounded 1c,
  loaded with LoadFontEx and explicit kana codepoints
- Theme struct per language with flag-based card backs (Hinomaru, Taegukgi, Trairong)
- Card art rendered to textures so the flip squashes the whole card
- Synthesized flip/match/mismatch/win/click sounds (new audio package)
- Shared ui package for text and buttons; Screen enum replaces i32 ids
- Kana <-> romaji pairs drawn from all 46 basic hiragana

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SansanandClaude Opus 5.5 committed 2026-10-01 20:47:04 +02:00
1 parent 5557de62a3
commit 5806f0498c
11 files changed
+1046 -425

No files matched your search

+84 -33
View File
@@ -2,40 +2,91 @@ package themes
import raylib "vendor:raylib"
SCREEN_WIDTH: i32 = 1280
SCREEN_HEIGHT: i32 = 720
SCREEN_WIDTH :: 1280
SCREEN_HEIGHT :: 720
JAPAN_PRIMARY: raylib.Color = raylib.Color{230, 57, 70, 255}
JAPAN_ACCENT: raylib.Color = raylib.Color{253, 184, 190, 255}
JAPAN_BACKGROUND: raylib.Color = raylib.Color{250, 245, 245, 255}
KOREA_PRIMARY: raylib.Color = raylib.Color{0, 71, 160, 255}
KOREA_ACCENT: raylib.Color = raylib.Color{180, 180, 255, 255}
KOREA_BACKGROUND: raylib.Color = raylib.Color{245, 248, 255, 255}
THAI_PRIMARY: raylib.Color = raylib.Color{165, 25, 49, 255}
THAI_ACCENT: raylib.Color = raylib.Color{255, 180, 200, 255}
THAI_BACKGROUND: raylib.Color = raylib.Color{255, 245, 248, 255}
WHITE: raylib.Color = raylib.Color{255, 255, 255, 255}
BLACK: raylib.Color = raylib.Color{0, 0, 0, 255}
DARK_GRAY: raylib.Color = raylib.Color{64, 64, 64, 255}
LIGHT_GRAY: raylib.Color = raylib.Color{200, 200, 200, 255}
CARD_BACK_COLOR: raylib.Color = raylib.Color{40, 40, 50, 255}
Screen :: enum {
MAIN_MENU,
JAPANESE_MENU,
JAPANESE_MEMORY,
KOREAN_MENU,
THAI_MENU,
}
BUTTON_WIDTH: i32 = 240
BUTTON_HEIGHT: i32 = 60
TITLE_FONT_SIZE: i32 = 72
SUBTITLE_FONT_SIZE: i32 = 24
BUTTON_FONT_SIZE: i32 = 24
// Which national flag the card backs are modelled on
Flag :: enum {
JAPAN, // Nisshōki / Hinomaru
KOREA, // Taegukgi
THAILAND, // Thong Trairong
}
CARD_WIDTH: i32 = 90
CARD_HEIGHT: i32 = 120
CARD_SPACING: i32 = 12
GRID_TOP: i32 = 140
GRID_ROWS: i32 = 4
GRID_COLS: i32 = 6
FLIP_DELAY: f32 = 1.0
Theme :: struct {
name: cstring,
flag: Flag,
primary: raylib.Color, // main brand color (buttons, titles)
secondary: raylib.Color, // second flag color
accent: raylib.Color, // highlights, matched outlines
background: raylib.Color,
card_face: raylib.Color,
ink: raylib.Color, // body text
}
MAIN_MENU: i32 = 0
JAPANESE_SCREEN: i32 = 1
JAPANESE_MEMORY: i32 = 2
KOREAN_SCREEN: i32 = 3
THAI_SCREEN: i32 = 4
// Flag colors
HINOMARU_RED :: raylib.Color{188, 0, 45, 255}
TAEGUK_RED :: raylib.Color{205, 46, 58, 255}
TAEGUK_BLUE :: raylib.Color{0, 71, 160, 255}
THAI_RED :: raylib.Color{165, 25, 49, 255}
THAI_BLUE :: raylib.Color{45, 42, 74, 255}
WHITE :: raylib.Color{255, 255, 255, 255}
BLACK :: raylib.Color{0, 0, 0, 255}
SUMI_INK :: raylib.Color{35, 31, 32, 255}
DARK_GRAY :: raylib.Color{80, 76, 72, 255}
LIGHT_GRAY :: raylib.Color{200, 200, 200, 255}
MENU_BACKGROUND :: raylib.Color{248, 246, 242, 255}
JAPAN :: Theme{
name = "Japanese",
flag = .JAPAN,
primary = HINOMARU_RED,
secondary = WHITE,
accent = raylib.Color{212, 160, 23, 255}, // kin (gold)
background = raylib.Color{250, 246, 238, 255}, // washi paper
card_face = raylib.Color{255, 252, 245, 255},
ink = SUMI_INK,
}
KOREA :: Theme{
name = "Korean",
flag = .KOREA,
primary = TAEGUK_BLUE,
secondary = TAEGUK_RED,
accent = raylib.Color{30, 30, 30, 255}, // trigram black
background = raylib.Color{244, 246, 251, 255},
card_face = raylib.Color{255, 255, 255, 255},
ink = raylib.Color{22, 24, 35, 255},
}
THAI :: Theme{
name = "Thai",
flag = .THAILAND,
primary = THAI_RED,
secondary = THAI_BLUE,
accent = raylib.Color{218, 165, 32, 255}, // temple gold
background = raylib.Color{251, 246, 240, 255},
card_face = raylib.Color{255, 253, 248, 255},
ink = raylib.Color{30, 28, 45, 255},
}
BUTTON_WIDTH :: 240
BUTTON_HEIGHT :: 60
TITLE_FONT_SIZE :: 72
SUBTITLE_FONT_SIZE :: 26
BUTTON_FONT_SIZE :: 26
CARD_WIDTH :: 96
CARD_HEIGHT :: 128
CARD_SPACING :: 14
GRID_TOP :: 136
GRID_ROWS :: 4
GRID_COLS :: 6