Game codes for Pokemon Academy Yiu Fai Kwok - 201198802 I have read the University Regulations on Plagiarism and state that the work covered by this declaration is my own and does not contain any unacknowledged work from other sources.

Dependencies:   mbed FXOS8700CQ mbed-rtos

Revision:
4:5bc9c4363d31
Parent:
2:464c7e62d97d
Child:
5:bc0691d02fd5
diff -r a799f0240063 -r 5bc9c4363d31 main.cpp
--- a/main.cpp	Wed Apr 03 03:19:59 2019 +0000
+++ b/main.cpp	Wed Apr 03 18:40:43 2019 +0000
@@ -109,9 +109,29 @@
                                     wait(1.0f/fps);
                                 }
                             select = start.get_select(start.update_select(pad));
-                            if(select == 1){currentGame = SQUIRTLE;}
-                            else if(select == 0){currentGame = BULBASAUR;}
-                            else if(select == 2){currentGame = CHARMANDER;}
+                            if(select == 1){
+                                music.congrats(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                game_1.intro(pad, lcd);
+                                currentGame = SQUIRTLE;
+                            }
+                            else if(select == 0){
+                                music.congrats(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = BULBASAUR;}
+                            else if(select == 2){
+                                music.congrats(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = CHARMANDER;}
                         break;
                         case BULBASAUR:
                         break;
@@ -153,16 +173,54 @@
                         case YEAR_2:
                             year_two();
                             year_two_set();
-                            if(select == 1){currentGame = SQUIRTLE;}
-                            else if(select == 0){currentGame = BULBASAUR;}
-                            else if(select == 2){currentGame = CHARMANDER;}
+                            if(select == 1){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = SQUIRTLE;
+                            }
+                            else if(select == 0){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = BULBASAUR;}
+                            else if(select == 2){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = CHARMANDER;}
                         break;
                         case YEAR_3:
                             year_three();
                             year_three_set();
-                            if(select == 1){currentGame = SQUIRTLE;}
-                            else if(select == 0){currentGame = BULBASAUR;}
-                            else if(select == 2){currentGame = CHARMANDER;}
+                            if(select == 1){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = SQUIRTLE;
+                            }
+                            else if(select == 0){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = BULBASAUR;}
+                            else if(select == 2){
+                                music.evolution_music(pad, lcd, select, year);
+                                while(pad.check_event(Gamepad::A_PRESSED) == false){
+                                    lcd.printString("PRESS A",0,5);
+                                    lcd.refresh();
+                                }
+                                currentGame = CHARMANDER;}
                         break;
                         case GRADUATION:
                             lcd.clear();
@@ -367,9 +425,9 @@
 
 void year_one_set()
 {
-    game_1_speed = 6;
+    game_1_speed = 7;
     game_1_cha = 1;
-    game_1_r = 7;
+    game_1_r = 6;
 }
 
 void year_two()