Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MinerEngine/MinerEngine.h
- Revision:
- 18:d4fccdf8d90e
- Parent:
- 17:3ba4ec25c4c5
--- a/MinerEngine/MinerEngine.h Tue May 12 09:22:31 2020 +0000 +++ b/MinerEngine/MinerEngine.h Tue May 12 12:38:14 2020 +0000 @@ -25,137 +25,118 @@ public: /** Constructor */ MinerEngine(); + /** Destructor */ ~MinerEngine(); + /** Initialise the components of the MinerEngine - * - * This function initialises the components of the MinerEngine. * @param winch_width - the width of the winch * @param winch_height - the height of the winch * @param gold_num - the gold number * @param monster_speed - the speed of monster */ void init(int winch_width,int winch_height,int gold_num,int monster_speed); + /** Initialise the unchanged parameter - * - * This function initialises the unchanged parameter. */ void init_unchanged_parameter(); + /** Switch the states - * - * This function switches the states. * @param pad - Gamepad library * @param lcd - N5110 library */ void state_switch(Gamepad &pad, N5110 &lcd); + /** Get the select - * - * This function gets the select from the gamepad. * @param pad - Gamepad library */ int get_select(Gamepad &pad); + /** Print the instruction - * - * This function prints the instruction on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void instruction(Gamepad &pad, N5110 &lcd); + /** Print the menu - * - * This function prints the menu on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void menu(Gamepad &pad, N5110 &lcd); + /** Select the difficulties - * - * This function selects the difficulties. * @param pad - Gamepad library * @param lcd - N5110 library */ void options(Gamepad &pad, N5110 &lcd); + /** Run the game - * - * This function runs the game loop. * @param pad - Gamepad library * @param lcd - N5110 library */ void game_run(Gamepad &pad, N5110 &lcd); + /** Draw all the components - * - * This function draws winch, claw, gold and monster on the screen. * @param lcd - N5110 library */ void draw(N5110 &lcd); + /** Read the gamepad input - * - * This function raed the gamepad input. * @param pad - Gamepad library */ void read_input(Gamepad &pad); + /** Update the data - * - * This function update all data components. * @param pad - Gamepad library */ void update(Gamepad &pad); + /** Print welcome component and wait for start - * - * This function prints welcome component on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void welcome(Gamepad &pad, N5110 &lcd); + /** Print game over on the screen - * - * This function prints game over on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void game_over(Gamepad &pad, N5110 &lcd); + /** Play the music - * - * This function plays the music. * @param pad - Gamepad library */ void play_music(Gamepad &pad); + /** Roll up the picture - * - * This function rolls up the picture. * @param pad - Gamepad library * @param lcd - N5110 library */ void screen_rollup(Gamepad &pad, N5110 &lcd); + /** Print loading on the screen - * - * This function prints loading on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void loading(Gamepad &pad, N5110 &lcd); + /** Play the tunnel animation on the screen - * - * This function plays the tunnel animation on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ void tunnel(Gamepad &pad, N5110 &lcd); + /** Draw the tunnel - * - * This function draws the tunnel. * @param lcd - N5110 library */ void draw_tunnel(N5110 &lcd); + /** Draw the walking man - * - * This function draws the walking man. * @param lcd - N5110 library */ void draw_man(N5110 &lcd); + /** Print message in the tunnel - * - * This function prints the message on the screen. * @param pad - Gamepad library * @param lcd - N5110 library */ @@ -165,31 +146,25 @@ private: /** Check if the gold has been lifted - * - * This function checks if the gold has been lifted. * @param pad - Gamepad library */ void check_gold_collision(Gamepad &pad); + /** Check if the monster collides with claw - * - * This function checks if the monster collides with claw. * @param pad - Gamepad library */ void check_monster_collision(Gamepad &pad); + /** Check if the claw gets the gold or the bottom - * - * This function checks if the claw gets the gold or the bottom. * @param pad - Gamepad library */ void check_claw_collision(Gamepad &pad); + /** Check if gold reloading is needed - * - * This function checks if gold reloading is needed. */ void check_gold_reload(); + /** Print the score on the screen - * - * This function prints the current score and highest score on the screen. * @param lcd - N5110 library */ void print_scores(N5110 &lcd);