A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.

Dependencies:   mbed MotionSensor

Revision:
47:6e31b195ce3c
Parent:
46:f09711580d4a
Child:
49:3f83ed62d123
diff -r f09711580d4a -r 6e31b195ce3c RoomEngine/RoomEngine.cpp
--- a/RoomEngine/RoomEngine.cpp	Wed May 08 20:47:52 2019 +0000
+++ b/RoomEngine/RoomEngine.cpp	Thu May 09 01:57:49 2019 +0000
@@ -109,11 +109,11 @@
     mapped_coord = gamepad.get_mapped_coord();
 }
 
-void RoomEngine::update()
+void RoomEngine::update(int &number_of_enemies_killed)
 {
     room->update_doorways();
     check_damage();
-    check_enemies_death();
+    check_enemies_death(number_of_enemies_killed);
     check_walls_collision();
     move();
     player->buttons(_A, _B, _Y, _X);
@@ -274,7 +274,7 @@
     }
 }
 
-void RoomEngine::check_enemies_death()
+void RoomEngine::check_enemies_death(int &number_of_enemies_killed)
 {
     // Enemy Death
     for (int i = 0; i < MAX_ENEMIES; i++) {
@@ -290,6 +290,7 @@
             }
             delete room->enemies[i];
             room->valid_enemies[i] = false;
+            number_of_enemies_killed++;
         }
     }
 }