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

Dependencies:   mbed MotionSensor

Revision:
11:63e54f6e7939
Parent:
10:1a3499f6b583
Child:
12:a1c1991835ca
diff -r 1a3499f6b583 -r 63e54f6e7939 Entity/Entity.h
--- a/Entity/Entity.h	Sun Apr 21 23:23:35 2019 +0000
+++ b/Entity/Entity.h	Tue Apr 23 03:10:09 2019 +0000
@@ -28,6 +28,7 @@
             float y;
         };
         Position position;
+        Position prev_pos;
         int hp;
         int face;
         
@@ -49,6 +50,20 @@
         
         virtual void chkdmg() = 0;
         
+        void undo_move_x(bool status_x){
+            if (status_x){
+                position.x = prev_pos.x;
+            }
+        }
+        
+        void undo_move_y(bool status_y){
+            if (status_y){
+                position.y = prev_pos.y;
+            }
+        }
+        
+        void update_prev_pos();
+        
         // Accessors
         bool get_moving();
         int get_hitbox_width();
@@ -60,6 +75,8 @@
         int get_offset_y();
         int get_pos_x();
         int get_pos_y();
+        int get_prev_pos_x();
+        int get_prev_pos_y();
 
 };