Fix missing collision for charger, spawner, and laser turret
All three new entity types were absent from the hardcoded enemy-type checks in is_enemy() (contact damage + projectile hits), homing projectile targeting, and drone targeting. Also adds proper death particle colors for charger (orange) and spawner (purple).
This commit is contained in:
@@ -188,8 +188,12 @@ static void damage_entity(Entity *target, int damage) {
|
||||
death_color = (SDL_Color){200, 60, 60, 255}; /* red debris */
|
||||
} else if (target->type == ENT_ENEMY_FLYER) {
|
||||
death_color = (SDL_Color){140, 80, 200, 255}; /* purple puff */
|
||||
} else if (target->type == ENT_TURRET) {
|
||||
} else if (target->type == ENT_TURRET || target->type == ENT_LASER_TURRET) {
|
||||
death_color = (SDL_Color){160, 160, 160, 255}; /* metal scraps */
|
||||
} else if (target->type == ENT_ENEMY_CHARGER) {
|
||||
death_color = (SDL_Color){220, 140, 40, 255}; /* orange spark */
|
||||
} else if (target->type == ENT_SPAWNER) {
|
||||
death_color = (SDL_Color){180, 60, 180, 255}; /* purple burst */
|
||||
} else {
|
||||
death_color = (SDL_Color){200, 200, 200, 255}; /* grey */
|
||||
}
|
||||
@@ -231,7 +235,8 @@ static void damage_player(Entity *player, int damage, Entity *source) {
|
||||
|
||||
static bool is_enemy(const Entity *e) {
|
||||
return e->type == ENT_ENEMY_GRUNT || e->type == ENT_ENEMY_FLYER ||
|
||||
e->type == ENT_TURRET;
|
||||
e->type == ENT_TURRET || e->type == ENT_ENEMY_CHARGER ||
|
||||
e->type == ENT_SPAWNER || e->type == ENT_LASER_TURRET;
|
||||
}
|
||||
|
||||
static void handle_collisions(EntityManager *em) {
|
||||
|
||||
Reference in New Issue
Block a user