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:
- 28:a38070a1cdcf
- Parent:
- 27:e73dd64ef334
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Miner/Miner.h Tue Apr 09 21:03:49 2019 +0000
@@ -0,0 +1,72 @@
+#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,
+ };
+
+class Miner
+{
+
+public:
+
+ Miner();
+ ~Miner();
+ void enemy_move(N5110 &lcd);
+ bool enemy_collision();
+ void enemy_init(int x, int y, int f);
+ 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);
+ Vector2D get_pos();
+
+private:
+
+ int _direction;
+ int _gravity;
+ int _jump;
+ int _y;
+ int _x;
+ int _ye;
+ int _xe;
+ int _distance;
+ int _turn_flag;
+ int _counter;
+
+
+};
+#endif
\ No newline at end of file