diff options
author | quou <quou@disroot.org> | 2023-05-05 13:44:23 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-05 13:44:23 +1000 |
commit | fb104368dd33b66e0575dcc0327cbae7046a4e1e (patch) | |
tree | 67a1a66182aa8417b8fbb431576528c28f4a5ab8 /player.c | |
parent | 280552fa4750b5dac9243782f9c0a7e0b7eea6f8 (diff) |
Add killing enemies.
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; |