aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/main.c b/main.c
index 499f313..b106978 100644
--- a/main.c
+++ b/main.c
@@ -1,14 +1,14 @@
#include "asset.h"
+#include "player.h"
#include "render.h"
+#include "standard.h"
#include "systems.h"
#include "world.h"
World world;
-Entity player;
void on_init(int argc, char** argv) {
- CSprite* sprite;
- CPosition* pos;
+ seed_rng(500);
init_renderer();
@@ -16,17 +16,12 @@ void on_init(int argc, char** argv) {
init_world(&world);
- player = new_entity(&world);
- add_components(&world, player, ctype_sprite | ctype_position);
- sprite = &world.sprites[player];
- pos = &world.positions[player];
- pos->x = 32;
- pos->y = 70;
- sprite->id = asset_id_char;
- sprite->rect = make_rect(0, 16, 16, 16);
+ init_player(&world.player, &world);
}
void on_update() {
+ renderer_begin_frame();
+ update_player(&world.player, &world);
sprite_system(&world);
}