Kaif Kutchwala 201267448 ELEC2645 Project

Dependencies:   mbed

Revision:
8:5ede90f99a27
Parent:
7:2a3b566aedd3
Child:
9:e6566d09f087
--- a/Game/Game.h	Sun May 17 00:59:51 2020 +0000
+++ b/Game/Game.h	Sun May 17 17:59:30 2020 +0000
@@ -15,25 +15,28 @@
         ~Game();
         /** @brief initialise game values*/
         void init();   
+        /** @brief combines all other functions to form main gameplay loop)*/
+        void play(Gamepad &pad, N5110 &lcd, Ball &ball);
         /** @brief reads values user inputs i.e. direction and power (x and y)*/
-        void readInput(Gamepad &pad, N5110 &lcd);
+        void readInput(Gamepad &pad, N5110 &lcd, Ball &ball);
         /** @brief updates score on screen*/
         void updateScore(N5110 &lcd);
         /** @brief updates number of lives on leds */
         void updateLives(Gamepad &pad);
-                     
+      
     private:
         /** @brief takes pointer input for aim on x-axis */
-        void pointer_input(Gamepad &pad, N5110 &lcd);
+        void pointer_input(Gamepad &pad, N5110 &lcd, Ball &ball);
         
         /** @brief takes power input for aim on y-axis */
-        void power_meter_input(Gamepad &pad, N5110 &lcd);
+        void power_meter_input(Gamepad &pad, N5110 &lcd, Ball &ball);
         
         /** @brief converts _x_val from pointer range (8-72) to screen range (0-84) */
         void convert_to_shot_x();
         
         /** @brief converts _y_val from power meter range (0-20) to goal range (0-24) */
         void convert_to_shot_y();
+        
         int _score;
         int _lives;
         int _level;
@@ -44,9 +47,6 @@
         int _speed;
         bool _is_goal;
     };
-    
-/** @brief displays constant background w/o obstacles */
-void display_background(N5110 &lcd);
 
 /** @brief displays obstacles for level
   * @param level @details number of level