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.
Dependencies: mbed
Diff: Frogger/Frogger.h
- Revision:
- 57:a6eb3a0e92bc
- Parent:
- 56:2797166656e0
- Child:
- 58:35560ce5eca3
--- a/Frogger/Frogger.h Tue May 26 20:51:56 2020 +0000 +++ b/Frogger/Frogger.h Tue May 26 21:09:40 2020 +0000 @@ -27,43 +27,98 @@ class Frogger { public: - + /** @param frog object that frogger class keeps track of + */ Frog *frog; // one frog object - int grid; // size of one game unit - IntroScreen intro; + /** Constructor */ + Frogger(); - Frogger(); + /** Constructor + * @brief This constructor is the main engine of the frogger class + * @param frog - actual frog object that user controls + * @param w - the size of the lcd width + * @param h - the size of the lcd height + */ Frogger(Frog *frog, int grid, int w, int h); // constructor public: + + /** @param current level of the game (starts from 1) + */ int current_level; + + /** @param current state of the frog, used to draw the animation of the frog + */ int state_frog; + + /** @param if the frog is in the water level, it can die now if it is + * not on the log + */ bool frogDie; + + /** @param store the x position of the goal post + */ int goal_post_xpos; + + /** @param user is playing the game right now + */ bool play_game; + + /** @param user is currently in the main menu + */ bool introScreen; + + /** @param user is currently reading the tutorial manual + */ bool tutorial; + + /** @param user is currently reading the settings + */ bool settings; - void gotoNextTutorialSlide(); - void displayTutorial(); - void goalReached(); - void checkProgression(); - + + /** @param if this on, then there exists an end post + */ bool end_post; + + /** @param frog is successful in current level + */ bool nextLevel; + + /** @param informs if the frog reached end post + */ bool next_goal; - + + /** @param this means that bonus round is screen is on + */ bool bonus_round; - float water_level; - bool frogOnLog; // attached + /** @param y coord (in rows) value of the water level + */ + float water_level; + + /** @param if the frog collides with log object and is above second + * safety lane, it is attached to the object (going same speed) + */ + bool frogOnLog; + + /** @param current state of the turtles, this is used to draw the animation + * of the turtle in level 2 + */ int turtle_state; public: - - Gamepad gamepad; // actual hardware object - + /** @param local hardware object, used for sounds, LED, and button controls etc. + */ + Gamepad gamepad; + + /** @param class object that keeps track of the current pointer position, current page + */ + IntroScreen intro; + + /** @param size of the game grid + */ + int grid; // size of one game unit int row_number; int grid_width; // screen width in grid units int lcd_w; @@ -154,7 +209,10 @@ void moveLogsLevelOne(); void checkFrogReachedRiver(); - + void gotoNextTutorialSlide(); + void displayTutorial(); + void goalReached(); + void checkProgression(); void moveLogsLevelTwo(); void drawFrogStates();