From 7664fdafb9a6d6f4aa3339fe38958b24b234218e Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Sep 2024 19:01:53 +1000 Subject: player slashing --- 1bitjam.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to '1bitjam.c') diff --git a/1bitjam.c b/1bitjam.c index 619876e..8c63aa5 100644 --- a/1bitjam.c +++ b/1bitjam.c @@ -1,20 +1,18 @@ #include "asset.h" #include "config.h" -#include "map.h" #include "maths.h" #include "memory.h" -#include "obj.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; - Player player; - Map map; + World* world; (void)argc; (void)argv; init_maths(); @@ -26,19 +24,19 @@ int entrypoint(int argc, const char** argv, Arena* m) { a = new_app(&h, game_name); init_audio(); init_fps(&f, default_mpf); - generate_floor(&map, 0); - init_player(&player); + world = arena_alloc(m, sizeof world); + init_world(world); + generate_floor(&world->map, 0); while (a->o) { fps_begin(&f); while (f.now >= f.next && a->o) { app_begin(a); - update_player(&player, a, &map); + update_world(world, a); ren_begin(&r, a->fb, viewport_w, viewport_h); ren_clear(&r); - render_map(&map, &r); - ren_player(&player, &r); + ren_world(world, &r); ren_end(&r); app_end(a); fps_update(&f); -- cgit v1.2.3-54-g00ecf