ELEC2645 (2018/19) / Mbed 2 deprecated el17arm

Dependencies:   mbed

Revision:
29:d85886364643
Parent:
27:e73dd64ef334
Child:
30:6d6b48fe3679
diff -r e73dd64ef334 -r d85886364643 Miner/Miner.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Miner/Miner.h	Wed Apr 10 00:50:14 2019 +0000
@@ -0,0 +1,80 @@
+#ifndef MINER_H
+#define MINER_H
+
+#include "mbed.h"
+#include "N5110.h"
+#include "Gamepad.h"
+
+const int miner_right[24] =   {
+        1,1,1,
+        1,1,0,
+        1,1,1,
+        0,1,0,
+        1,1,1,
+        1,1,1,
+        0,1,0,
+        0,1,1,
+
+    };
+
+    const int miner_left[24] =   {
+        1,1,1,
+        0,1,1,
+        1,1,1,
+        0,1,0,
+        1,1,1,
+        1,1,1,
+        0,1,0,
+        1,1,0,
+    };
+
+const int enemy[15] =   {
+        
+        1,1,1,
+        1,0,1,
+        1,1,1,
+        0,1,0,
+        1,1,1,
+    };
+    
+struct enemies {
+    bool eflag[5];
+    double ex[5];
+    double ey[5];
+    int counter[5];
+    int distance[5];
+};
+
+class Miner
+{
+
+public:
+    
+    Miner();
+    ~Miner();
+    
+    void miner_init(int x, int y);
+    void miner_move(Direction d, N5110 &lcd);
+    void miner_draw(N5110 &lcd);
+    void miner_gravity(N5110 &lcd);
+    void miner_jump(N5110 &lcd, Gamepad &pad);
+    void miner_land(N5110 &lcd);
+    
+    void enemy_init(int i, int x, int y, int d);
+    void enemy_move(int i, double v, N5110 &lcd);
+    bool enemy_collision(int i);
+    
+    Vector2D get_pos();
+
+private:
+
+    int _direction;
+    int _gravity;
+    int _jump;
+    int _y;
+    int _x;
+    
+    enemies _enem;
+    
+};
+#endif
\ No newline at end of file