Files
HanjaKanaMun/main.odin
T
2026-10-01 20:40:13 +02:00

56 lines
1.7 KiB
Odin

package main
import raylib "vendor:raylib"
import themes "src/themes"
import screens "src/screens"
import memory "src/memory"
import assets "src/assets"
current_screen: i32 = themes.MAIN_MENU
mouse_x: i32
mouse_y: i32
main :: proc() {
raylib.InitWindow(themes.SCREEN_WIDTH, themes.SCREEN_HEIGHT, cstring("HanjaKanaMun"))
defer raylib.CloseWindow()
assets.load_fonts()
defer assets.unload_fonts()
raylib.SetTargetFPS(60)
memory.init_memory_game()
for !raylib.WindowShouldClose() {
mouse_x = raylib.GetMouseX()
mouse_y = raylib.GetMouseY()
if raylib.IsKeyPressed(raylib.KeyboardKey.ESCAPE) {
current_screen = themes.MAIN_MENU
}
if current_screen == themes.JAPANESE_MEMORY {
delta_time := raylib.GetFrameTime()
memory.update_memory_game(delta_time, mouse_x, mouse_y)
}
raylib.BeginDrawing()
if current_screen == themes.MAIN_MENU {
current_screen = screens.draw_main_menu(mouse_x, mouse_y)
} else if current_screen == themes.JAPANESE_SCREEN {
current_screen = screens.draw_japanese_screen(mouse_x, mouse_y)
if current_screen == themes.JAPANESE_MEMORY {
memory.init_memory_game()
}
} else if current_screen == themes.JAPANESE_MEMORY {
current_screen = memory.draw_memory_game(mouse_x, mouse_y)
} else if current_screen == themes.KOREAN_SCREEN {
current_screen = screens.draw_korean_screen(mouse_x, mouse_y)
} else if current_screen == themes.THAI_SCREEN {
current_screen = screens.draw_thai_screen(mouse_x, mouse_y)
}
raylib.EndDrawing()
}
}