aboutsummaryrefslogtreecommitdiff
path: root/collision_system.c
diff options
context:
space:
mode:
Diffstat (limited to 'collision_system.c')
-rw-r--r--collision_system.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/collision_system.c b/collision_system.c
index 2a1ac03..cf1378c 100644
--- a/collision_system.c
+++ b/collision_system.c
@@ -58,10 +58,13 @@ static void handle_bullet_vs_enemy(
Entity enemy
) {
CEnemy* e;
+ const CPosition* pos;
+ pos = &world->positions[bullet];
e = &world->enemies[enemy];
e->hp--;
destroy_entity(world, bullet);
+ new_player_bullet_explosion(world, pos->x, pos->y);
}
static void handle_bullet_vs_solid(
@@ -73,10 +76,12 @@ static void handle_bullet_vs_solid(
unsigned bbits;
bbits = world->bitmask[bullet];
+ pos = &world->positions[bullet];
if (bbits & ctype_enemy_bullet) {
- pos = &world->positions[bullet];
new_enemy_bullet_explosion(world, pos->x, pos->y);
+ } else if (bbits & ctype_player_bullet) {
+ new_player_bullet_explosion(world, pos->x, pos->y);
}
destroy_entity(world, bullet);