From a72420a85fdfe85d6a6e67b8c70ed11537d532bd Mon Sep 17 00:00:00 2001 From: quou Date: Sat, 6 May 2023 20:30:58 +1000 Subject: Work on visual effects; Debris and player bullet impact effects. --- collision_system.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'collision_system.c') 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); -- cgit v1.2.3-54-g00ecf