From 0e75a2949678cb8a68fb0819355864aa6db2cb43 Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 5 Oct 2024 12:13:47 +1000 Subject: Level transitions and main menu --- 1bitjam.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to '1bitjam.c') diff --git a/1bitjam.c b/1bitjam.c index 547eee7..1b903c1 100644 --- a/1bitjam.c +++ b/1bitjam.c @@ -1,18 +1,17 @@ #include "asset.h" #include "config.h" +#include "game.h" #include "maths.h" #include "memory.h" #include "plat.h" -#include "rect.h" #include "render.h" -#include "world.h" int entrypoint(int argc, const char** argv, Arena* m) { Heap h; App* a; FPS f; Renderer r; - World* world; + Game* game; (void)argc; (void)argv; init_maths(); @@ -24,19 +23,16 @@ int entrypoint(int argc, const char** argv, Arena* m) { a = new_app(&h, game_name); init_audio(); init_fps(&f, default_mpf); - world = arena_alloc(m, sizeof world); - init_world(world); - generate_floor(&world->map, world); + game = arena_alloc(m, sizeof *game); + init_game(game, game_state_menu); while (a->o) { fps_begin(&f); while (f.now >= f.next && a->o) { app_begin(a); - - update_world(world, a); - + update_game(game, a); ren_begin(&r, a->fb, viewport_w, viewport_h); ren_clear(&r); - ren_world(world, &r); + ren_game(game, &r); ren_end(&r); app_end(a); fps_update(&f); -- cgit v1.2.3-54-g00ecf