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: Life_Powerup/Life_Powerup.h
- Revision:
- 129:b47c28c7eaaf
- Parent:
- 114:280903dd7e06
- Child:
- 130:46f3fac2bdf9
--- a/Life_Powerup/Life_Powerup.h Wed May 08 21:32:23 2019 +0000 +++ b/Life_Powerup/Life_Powerup.h Wed May 08 23:09:59 2019 +0000 @@ -28,18 +28,44 @@ class Life_Powerup { +public: -public: + /** Constructor declaration */ Life_Powerup(); + + /** Destructor declaration */ ~Life_Powerup(); + + /** Initialises the powerup off screen with a set velocity */ void init(); + + /** Draws the powerup at at its current coordinates on the LCD + * @param &lcd @details a N5110 pointer + */ void draw(N5110 &lcd); + + /** Update the powerup's y coordinate based on its velocity */ void update(); - /// accessors and mutators + + /** Sets the powerups's x coordinate + * @param x @details set the member variable _x to the new local x + */ + void set_posx(int x); + + /** Sets the powerups's x coordinate + * @param y @details set the member variable _y to the new local y + */ + void set_posy(int y); + + /** Retrieve the powerup's current x coordinate + * @return returns member variable _x as an integer + */ int get_x(); + + /** Retrieve the powerup's current y coordinate + * @return returns member variable _y as an integer + */ int get_y(); - void set_posx(int x); - void set_posy(int y); private: int _speed_y;