ELEC2645 (2018/19) / Mbed 2 deprecated el17arm

Dependencies:   mbed

Revision:
28:a38070a1cdcf
Parent:
27:e73dd64ef334
--- 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);