blob: 4ed48a253e5f6c9f63332dda0d5dac1b63bae128 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "engine/enemy.h"
void hh_multiple_enemies(hh_entity* enemies, hh_entity player, vec_cor cam_pos, int total_enemies){
for(int i=0; i < total_enemies;i++){
hh_update_enemy(&enemies[i] , player, cam_pos);
}
}
void hh_enemy_death_check(hh_entity* enemy){
if(enemy->hp == 0){
enemy->is_hit=false;
enemy->pos = (vec2){-16, -16};
}
else{
enemy->hp--;
}
}
void hh_solve_hitted_enemies(hh_entity* enemies, int total_enemies){
for(int i = 0; i < total_enemies; i++){
if(enemies[i].is_hit){
hh_enemy_death_check(&enemies[i]);
}
}
}
|