diff options
Diffstat (limited to 'player.c')
-rw-r--r-- | player.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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; |