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

Dependencies:   mbed MotionSensor

Revision:
27:a1b41626f57c
Parent:
26:abbc19edc5c1
Child:
28:98848e6a77a2
--- a/Entity/Entity.cpp	Mon Apr 29 02:45:17 2019 +0000
+++ b/Entity/Entity.cpp	Mon Apr 29 10:39:09 2019 +0000
@@ -18,12 +18,12 @@
     prev_pos = position;
 }
 
-bool Entity::matrix_collision_test(float pos_x, float pos_y, int map_no)
-{
+bool Entity::matrix_collision_test(float pos_x, float pos_y, int * map)
+{      
     for (int j = pos_y; j < (int)pos_y + hitbox.height; j++) {
         for(int i = pos_x; i < (int)pos_x + hitbox.width; i++) {
-            if ((j>=48) || (i>=84) || (j<0) || (i<0)) {}
-            else if ((level_map[0][j][i] == 1)) {
+            if ((j>=screen_height) || (i>=screen_width) || (j<0) || (i<0)) {} // To allow movement towards outside of the map
+            else if (*((map+j*screen_width)+i) == 1) {
                 return true;
             }
         }