Kaif Kutchwala 201267448 ELEC2645 Project
Dependencies: mbed
Diff: Game/Game.h
- Revision:
- 7:2a3b566aedd3
- Parent:
- 6:09a555c0d997
- Child:
- 8:5ede90f99a27
--- a/Game/Game.h Sat May 16 17:23:17 2020 +0000 +++ b/Game/Game.h Sun May 17 00:59:51 2020 +0000 @@ -15,10 +15,6 @@ ~Game(); /** @brief initialise game values*/ void init(); - /** @brief displays obstacles for level - * @param level @details number of level - */ - void displayLevel(int level, N5110 &lcd); /** @brief reads values user inputs i.e. direction and power (x and y)*/ void readInput(Gamepad &pad, N5110 &lcd); /** @brief updates score on screen*/ @@ -27,15 +23,39 @@ void updateLives(Gamepad &pad); private: + /** @brief takes pointer input for aim on x-axis */ + void pointer_input(Gamepad &pad, N5110 &lcd); + + /** @brief takes power input for aim on y-axis */ + void power_meter_input(Gamepad &pad, N5110 &lcd); + + /** @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; int _x_val; int _y_val; + int _shot_x; + int _shot_y; int _speed; bool _is_goal; }; + +/** @brief displays constant background w/o obstacles */ void display_background(N5110 &lcd); -void calculate_angle(); -int random_level_gen(); + +/** @brief displays obstacles for level + * @param level @details number of level + */ +void displayLevel(int level, N5110 &lcd); + +/** @brief generates random value for given limit + * @param limit @details sets max limit for random generator + */ +int random_level_gen(int limit); + #endif \ No newline at end of file