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: main.cpp
- Revision:
- 28:a38070a1cdcf
- Parent:
- 27:e73dd64ef334
diff -r e73dd64ef334 -r a38070a1cdcf main.cpp
--- a/main.cpp Tue Apr 09 18:46:14 2019 +0000
+++ b/main.cpp Tue Apr 09 21:03:49 2019 +0000
@@ -1,10 +1,12 @@
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
+#include "Gameengine.h"
#include "Levelobjects.h"
+Levelobjects obj;
+Gameengine game;
Key _k;
-Levelobjects obj;
Gamepad pad;
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
AnalogIn pot0(PTB2);
@@ -24,7 +26,7 @@
contrast();
render();
- obj.update(lcd, pad);
+ game.update(lcd, pad);
restart();
wait(0.1);
}
@@ -40,12 +42,12 @@
pad.init();
pad.leds_off();
contrast();
- obj.game_init();
+ game.game_init();
}
void render()
{
- obj.draw(_k, lcd, pad);
+ game.draw(_k, lcd, pad);
}
void contrast()
@@ -71,7 +73,7 @@
void restart()
{
- if (obj.game_over() == true) {
+ if (game.game_over() == true) {
lcd.clear();
lcd.printString("Game Over! ",16,1);
lcd.printString("Press reset to try again! ",0,3);