aboutsummaryrefslogtreecommitdiff
path: root/src/engine/enemy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/enemy.c')
-rw-r--r--src/engine/enemy.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/engine/enemy.c b/src/engine/enemy.c
new file mode 100644
index 0000000..186cfa0
--- /dev/null
+++ b/src/engine/enemy.c
@@ -0,0 +1,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]);
+ }
+ }
+}