James Cummins / Mbed 2 deprecated el17jnc

Dependencies:   mbed

Revision:
10:40c77d69e83c
Parent:
9:ce0a12fb205b
Child:
11:2cf0d4ce8677
--- a/main.cpp	Wed Apr 10 12:54:56 2019 +0000
+++ b/main.cpp	Thu Apr 11 08:08:52 2019 +0000
@@ -16,23 +16,30 @@
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 void startscreen();
 int menu();
+GameEngine engine;
 
 
 ////////////////Main Command//////////////////
 
 
 int main(){
-    gamepad.init();
-    lcd.init();
-    lcd.setContrast(0.55);
-    wait(1);
+    init();
     startscreen();
     int choice_selected = menu();
+    if(choice_selected == 0){ engine.classic();}
+    if(choice_selected == 1){ engine.brickbreaker();}
+    if(choice_selected == 2){ engine.options_menu();}
 }
   
   
 //////////////Start up functions///////////////////
-  
+void init(){
+    gamepad.init();
+    lcd.init();
+    lcd.setContrast(0.55);
+    engine.init();
+    wait(1);
+}
     
 void startscreen() {
     lcd.clear();