aboutsummaryrefslogtreecommitdiff
path: root/1bitjam.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-30 19:01:53 +1000
committerquou <quou@disroot.org>2024-09-30 19:01:53 +1000
commit7664fdafb9a6d6f4aa3339fe38958b24b234218e (patch)
treea1b1879403eab088aee66c091e476d407fe35402 /1bitjam.c
parent98322a86ec78f732a5a6750a1e93061269cc76a7 (diff)
player slashing
Diffstat (limited to '1bitjam.c')
-rw-r--r--1bitjam.c16
1 files changed, 7 insertions, 9 deletions
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);