blob: 186cfa0648734ef61f3a75ea27be827fa8d2cea2 (
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
28
29
30
31
|
#include "engine/enemy.h"
void hh_update_enemy(hh_entity* enemy, vec_cor cam_pos){
//Bjorn functions
}
void hh_multiple_enemies( vec_cor cam_pos, hh_entity* enemies, int total_enemies){
for(int i=0; i < total_enemies;i++){
hh_update_enemy(&enemies[i] , 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]);
}
}
}
|