Mochu Yao explorer game
Dependencies: mbed
Diff: Gameengine/Gameengine.h
- Revision:
- 28:4a1260ad0346
- Parent:
- 27:354d91d59b6d
- Child:
- 33:ea83f08fa466
--- a/Gameengine/Gameengine.h Tue Apr 28 17:58:00 2020 +0000 +++ b/Gameengine/Gameengine.h Tue Apr 28 18:21:22 2020 +0000 @@ -11,6 +11,7 @@ #include <cstdlib> #include <ctime> +/** Coordinate struct */ struct Coordinate { Vector2D coord; /**< Vector 2D for joystick coords */ }; @@ -21,7 +22,8 @@ * @3 draw on the lcd screen and load the gamepad controll * @date April 24th 2020 * @author Yaomochu -* @code + +@code #include "mbed.h" #include "N5110.h" @@ -53,30 +55,95 @@ } } -* @endcode +@endcode */ class Gameengine { // Constructor and destructor. public: +// Constructor and destructor. + /** + * @brief Constructor + * @details Non user specified. + */ Gameengine(); +/** + * @brief Destructor + * @details Non user specified. + */ ~Gameengine(); -//first init all the parameter + // Mutators. + /** + * @brief Initalises the Gameengine. + */ void init(); + /** + * @brief reset the gameengine. + */ void reset_game_engine(); + /** + * @brief get the coordinate and the button_flag. + * @param &gamepad @details The gamepad object from Gamepad class. + */ void read_input(Gamepad &pad); + /** + * @brief check and flesh the reset flag. + * @param &gamepad @details The gamepad object from Gamepad class. + * @param &lcd @details The lcd object from the N5110 class + */ void check_reset(N5110 &lcd, Gamepad &gamepad); + /** + * @brief check and flesh the collision flag. + * @param &gamepad @details The gamepad object from Gamepad class. + */ void check_collision(Gamepad &gamepad); + /** + * @brief check and flesh the start flag. + * @param &gamepad @details The gamepad object from Gamepad class. + * @param &lcd @details The lcd object from the N5110 class + */ void check_start(N5110 &lcd, Gamepad &gamepad); + /** + * @brief set the fall flag for engine. + */ void set_fall_flag(); + /** + * @brief get the start flag. + */ bool get_start_flag(); + /** + * @brief generate the upper and lower lines. + */ void generate_lines(); + /** + * @brief get the player score. + */ int get_score(); + /** + * @brief get the player's direction. + */ void get_explorer_direction(); + /** + * @brief get the item and explorer sprite. + */ void get_sprite(); + /** + * @brief get player's y. + * @param &gamepad @details The gamepad object from Gamepad class. + */ void get_explorer_y(Gamepad &gamepad); + /** + * @brief get player's y. + */ void get_explorer_x(); + /** + * @brief Updates the LCD display. + * @param &lcd @details The lcd object from the N5110 class. + */ void update_lcd(N5110 &lcd); + /** + * @brief run the game. + */ void run_engine(N5110 &lcd, Gamepad &gamepad);