ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Revision:
20:a8cad4e044ea
Parent:
18:304700b5d8f8
Child:
21:20478f086bc2
--- a/EngineController/EngineController.cpp	Mon Apr 15 18:49:35 2019 +0000
+++ b/EngineController/EngineController.cpp	Tue Apr 16 19:19:43 2019 +0000
@@ -32,7 +32,7 @@
 void EngineController::run_game_engine(N5110 &lcd, Gamepad &gamepad) {
   // The main game loop that first checks if the game has just started and runs
   // the game.
-  check_for_start(lcd);
+  check_for_start(lcd, gamepad);
   if(_game_counter == 100) _game_counter = 0;
   update_game(lcd, gamepad);
   if (_game_counter % _speed_divider == 0) _game_engine.generate_level(_game_counter);  
@@ -41,10 +41,10 @@
   _speed_divider = int(-0.25*_player_score + 10);
 }
 
-void EngineController::check_for_start(N5110 &lcd) {
+void EngineController::check_for_start(N5110 &lcd, Gamepad &gamepad) {
   // Print the intro text if the game has just started.
   if(_start_platform) print_intro_text(lcd);
-  _game_engine.check_reset(lcd);
+  _game_engine.check_reset(lcd, gamepad);
   _start_platform = _game_engine.get_start_platform();
 }
 
@@ -57,10 +57,10 @@
   // Run the game engine.
   _game_engine.read_input(gamepad);
   _game_engine.set_level_condition();
-  _game_engine.process_y();
+  _game_engine.process_y(gamepad);
   _game_engine.process_x(_game_counter);
   _game_engine.process_sprite();
-  _game_engine.check_coin_collision();
-  _game_engine.check_fire_collision();
+  _game_engine.check_coin_collision(gamepad);
+  _game_engine.check_fire_collision(gamepad);
   _game_engine.update_lcd(lcd);
 }