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:
- 0:fe19852199d2
- Child:
- 1:813ba5341985
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Minerengine.cpp Tue Mar 19 09:49:12 2019 +0000
@@ -0,0 +1,47 @@
+#include "Minerengine.h"
+
+Minerengine::Minerengine()
+{
+}
+
+void Minerengine::minermove(N5110 &lcd, Gamepad &pad)
+{
+
+ printf("hello world /n");
+ lcd.drawSprite(WIDTH/2 + x_direction,HEIGHT/2 + y_direction,13,5,(int *)miner_right);
+
+ Direction d = pad.get_direction();
+ printf("Direction = %i\n",d);
+
+ if (d==3) {
+
+ x_direction = x_direction + 1;
+ lcd.clear();
+ lcd.drawSprite(WIDTH/2 + x_direction,HEIGHT/2 + y_direction,13,5,(int *)miner_right);
+ lcd.refresh();
+ wait(0.05);
+ }
+
+ if (d == 7) {
+
+ x_direction = x_direction - 1;
+ lcd.clear();
+ lcd.drawSprite(WIDTH/2 + x_direction,HEIGHT/2 + y_direction,13,5,(int *)miner_left);
+ lcd.refresh();
+ wait(0.05);
+ }
+ //lcd.drawSprite(WIDTH/2 + x,HEIGHT/2 + y,13,5,(int *)miner);
+ lcd.refresh();
+
+ if(pad.check_event(Gamepad::A_PRESSED)) {
+
+
+ printf("A pressed");
+ y_direction = y_direction - 6;
+ lcd.clear();
+ lcd.drawSprite(WIDTH/2 + x_direction,HEIGHT/2 + y_direction,13,5,(int *)miner_right);
+ wait(0.2);
+ y_direction = y_direction + 6;
+
+ }
+}
\ No newline at end of file