ELEC2645 (2018/19) / Mbed 2 deprecated ll16o2l_ELEC2645

Dependencies:   mbed Gamepad

Revision:
10:0c200ed5973a
Parent:
8:c3153fd4d8ce
Child:
11:1c5c549ba75e
--- a/main.cpp	Tue Apr 30 09:27:09 2019 +0000
+++ b/main.cpp	Tue Apr 30 09:32:46 2019 +0000
@@ -32,12 +32,14 @@
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 Gamepad pad;
 DodgeEngine dodge;
+Instruction instruction;
 
 ///////////// prototypes ///////////////
 void init();
 void update_game(UserInput input);
 void render();
 void welcome();
+void instructions();
 
 ///////////// functions ////////////////
 int main()
@@ -47,6 +49,7 @@
 
     init();     // initialise and then display welcome screen
     welcome();  // waiting for the user to start
+    instructions(); // waiting for the user to start
     
     render();  // first draw the initial frame 
     wait(1.0f/fps);  // and wait for one frame period
@@ -118,4 +121,10 @@
         pad.leds_off();
         wait(0.1);
     }
+}
+
+void instruction() {
+    while (pad.check_event(Gamepad::A) == false) {
+        instruction.write(lcd, pad);
+    }
 }
\ No newline at end of file