blob: 499f313a3136a2be231453370be2046ae92b4fec (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include "asset.h"
#include "render.h"
#include "systems.h"
#include "world.h"
World world;
Entity player;
void on_init(int argc, char** argv) {
CSprite* sprite;
CPosition* pos;
init_renderer();
load_assets();
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);
}
void on_update() {
sprite_system(&world);
}
void on_deinit() {
}
|