#include "menu_scene.h" #include "scene_manager.h" #include "sokol/sokol_app.h" static void menu_enter(app_context_t* ctx) { (void)ctx; if (ctx && ctx->pass_action) { ctx->pass_action->colors[0].clear_value = (sg_color){ 0.20f, 0.20f, 0.25f, 1.0f }; } } static void menu_update(app_context_t* ctx, float dt) { (void)ctx; (void)dt; } static void menu_render(app_context_t* ctx) { (void)ctx; } static void menu_event(app_context_t* ctx, const sapp_event* ev) { (void)ctx; if (ev->type == SAPP_EVENTTYPE_KEY_DOWN && ev->key_code == SAPP_KEYCODE_SPACE) { /* Switch to game scene on space */ extern Scene GameScene; scene_manager_set(&GameScene); return; } if (ev->type == SAPP_EVENTTYPE_TOUCHES_BEGAN) { /* Any touch begins: treat as tap to start */ extern Scene GameScene; scene_manager_set(&GameScene); return; } if (ev->type == SAPP_EVENTTYPE_MOUSE_DOWN) { /* Also allow mouse click for desktop */ extern Scene GameScene; scene_manager_set(&GameScene); return; } } static void menu_exit(app_context_t* ctx) { (void)ctx; } Scene MenuScene = { .name = "Menu", .on_enter = menu_enter, .on_update = menu_update, .on_render = menu_render, .on_event = menu_event, .on_exit = menu_exit, };