diff options
| author | quou <quou@disroot.org> | 2023-05-06 20:30:58 +1000 | 
|---|---|---|
| committer | quou <quou@disroot.org> | 2023-05-06 20:30:58 +1000 | 
| commit | a72420a85fdfe85d6a6e67b8c70ed11537d532bd (patch) | |
| tree | 387ce06b39590ba1b90935fcbf71ed03c4f912b9 /collision_system.c | |
| parent | 2e0f7c263b197d72fea7701d566e4a62e892fefe (diff) | |
Work on visual effects; Debris and player bullet impact effects.
Diffstat (limited to 'collision_system.c')
| -rw-r--r-- | collision_system.c | 7 | 
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); |