ELEC2645 (2018/19) / Mbed 2 deprecated el17arm

Dependencies:   mbed

Revision:
38:55bb9da08a52
Parent:
37:4d525a37d5d2
Child:
39:ddca28745388
Child:
40:913339e324b8
--- a/Sprites/Sprites.h	Fri Apr 12 18:10:11 2019 +0000
+++ b/Sprites/Sprites.h	Sun Apr 14 15:18:58 2019 +0000
@@ -62,7 +62,6 @@
         1,1,1,1,1,1,
         1,0,1,1,0,1,
         1,1,1,1,1,1,
-        
     };
     
 const int door[30] = {
@@ -74,15 +73,46 @@
         1,1,0,1,1,
         1,0,1,0,1,
 };
-    
-struct enemies {
-    bool eflag[5];
-    double ex[5];
-    double ey[5];
-    int counter[5];
-    int distance[5];
-    
-    
+
+///////structs for sprites detection///////////////////
+
+struct keyed {
+    bool key[5];
+    double kx[5];
+    double ky[5];
+};
+
+////////structs for populating levels//////////////////
+
+struct Enemies {
+    bool eflag;
+    double ex;
+    double ey;
+    int counter;
+    int distance;
+
+};
+
+struct Traps {
+    double tx;
+    double ty;
+};
+
+struct Keys {
+    bool k;
+    double kx;
+    double ky;
+};
+
+struct Solid_blocks {
+    double bx;
+    double by;
+};
+
+struct Soft_blocks {
+    double sx;
+    double sy;
+    int sz;
 };
 
 class Sprites
@@ -105,16 +135,18 @@
     bool enemy_collision(int i);
     
     void key_collect(int k, int x, int y, N5110 &lcd, Gamepad &pad);
-    int keys_collected();
+    bool keys_collected();
     
     bool exit_level(int x, int y, N5110 &lcd);
     
     bool trap(int x, int y, N5110 &lcd);
-    void blocks(Direction d, int b, int x, int y, N5110 &lcd);
-    void soft_blocks(int x, int y, N5110 &lcd);
+    void blocks(Direction d, int x, int y, N5110 &lcd);
+    void soft_blocks(int x, int y, int z, N5110 &lcd);
     
     Vector2D get_pos();
 
+    keyed _k;
+
 private:
 
     int _direction;
@@ -134,10 +166,13 @@
     
     double bx[5];
     double by[5];
-    enemies _enem;
+
     bool _key[5];
     double kx[5];
     double ky[5];
+    
+    int _enem_flag;
+    
 
     
 };