aboutsummaryrefslogtreecommitdiff
path: root/player.c
diff options
context:
space:
mode:
Diffstat (limited to 'player.c')
-rw-r--r--player.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/player.c b/player.c
index b723849..b2dbf29 100644
--- a/player.c
+++ b/player.c
@@ -11,6 +11,7 @@ void init_player(Player* player, World* world) {
CSprite* sprite;
CPosition* pos;
CAnimated* animated;
+ CCollider* col;
Entity e;
e = new_entity(world);
@@ -20,11 +21,14 @@ void init_player(Player* player, World* world) {
e,
ctype_sprite |
ctype_position |
- ctype_animated
+ ctype_animated |
+ ctype_collider |
+ ctype_player
);
pos = &world->positions[e];
sprite = &world->sprites[e];
animated = &world->animateds[e];
+ col = &world->colliders[e];
pos->x = 32 << fbits;
pos->y = 70 << fbits;
@@ -36,6 +40,11 @@ void init_player(Player* player, World* world) {
animated->frame = 0;
animated->timer = 0;
+ col->x = 3 << fbits;
+ col->y = 1 << fbits;
+ col->w = 10 << fbits;
+ col->h = 15 << fbits;
+
player->face = 0;
player->shoot_cooldown = 15;
player->shoot_countdown = 0;