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: Minerengine.cpp
- Revision:
- 7:c6e6ec0e3396
- Parent:
- 6:866281ce2b44
- Child:
- 8:9bc80e40ac0d
--- a/Minerengine.cpp Fri Mar 22 02:00:48 2019 +0000
+++ b/Minerengine.cpp Mon Mar 25 11:19:20 2019 +0000
@@ -1,16 +1,24 @@
#include "Minerengine.h"
+ int _x;
+ int _y;
+
Minerengine::Minerengine()
{
- _x = 3;
- _y = 33;
}
Minerengine::~Minerengine()
{
}
+/*void Minerengine::miner_init()
+{
+ _x = 3;
+ _y = 33;
+}
+*/
+
void Minerengine::read_direction(Gamepad &pad)
{
_d = pad.get_direction();
@@ -32,6 +40,7 @@
_x = _x - 1;
_direction = 0;
}
+ x = _x;
}
void Minerengine::miner_jump(N5110 &lcd, Gamepad &pad)
@@ -81,5 +90,6 @@
{
if(!lcd.getPixel(_x, _y + 8)) {
_y = _y + 1;
+ wait(0.1);
}
-}
+}
\ No newline at end of file