Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Miner/Miner.h
- Revision:
- 32:5dc769ba4a58
- Parent:
- 30:6d6b48fe3679
diff -r 6d6b48fe3679 -r 5dc769ba4a58 Miner/Miner.h
--- a/Miner/Miner.h Wed Apr 10 14:29:14 2019 +0000
+++ b/Miner/Miner.h Wed Apr 10 17:19:51 2019 +0000
@@ -38,6 +38,43 @@
1,1,1,
};
+const int key[12] = {
+ 1,1,0,0,
+ 1,0,1,1,
+ 1,1,0,1,
+ };
+
+const int key_collected[12] = {
+
+ 0,0,0,0,
+ 0,0,0,0,
+ 0,0,0,0,
+ };
+
+const int spike[9] = {
+
+ 1,1,1,
+ 0,1,0,
+ 1,1,1,
+ };
+
+const int solid_block[9] = {
+
+ 1,1,1,
+ 1,0,1,
+ 1,1,1,
+ };
+
+const int door[30] = {
+
+ 1,1,1,1,1,
+ 1,0,1,0,1,
+ 1,1,0,1,1,
+ 1,0,1,0,1,
+ 1,1,0,1,1,
+ 1,0,1,0,1,
+};
+
struct enemies {
bool eflag[5];
double ex[5];
@@ -46,6 +83,10 @@
int distance[5];
};
+struct Key{
+ bool key[5];
+};
+
class Miner
{
@@ -65,6 +106,15 @@
void enemy_move(int i, double v, N5110 &lcd);
bool enemy_collision(int i);
+ void key_collect(int k, int x, int y, N5110 &lcd, Gamepad &pad);
+ int keys_collected();
+
+ bool exit_level(int x, int y, N5110 &lcd);
+
+ bool trap(int x, int y, N5110 &lcd);
+ void draw_solid_block(int x, int y, N5110 &lcd);
+ void soft_blocks(int x, int y, N5110 &lcd);
+
Vector2D get_pos();
private:
@@ -77,6 +127,9 @@
bool _j_flag;
int _j_counter;
+ Key _k;
+ int _keys;
+
enemies _enem;
};