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: RosenEngine/RosenEngine.h
- Revision:
- 51:2231e2e141b9
- Parent:
- 50:69fc9b5e3335
- Child:
- 52:29772e31a620
diff -r 69fc9b5e3335 -r 2231e2e141b9 RosenEngine/RosenEngine.h --- a/RosenEngine/RosenEngine.h Thu May 09 06:02:20 2019 +0000 +++ b/RosenEngine/RosenEngine.h Thu May 09 08:42:25 2019 +0000 @@ -39,24 +39,24 @@ */ void reset(); /** An accessor method that reads the input from the gamepad - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void read_input(Gamepad &pad); /** A mutator method that updates all position and variable values based on inputs and the * time that has passed - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void update(Gamepad &pad); /** Draws all game assets on lcd display - *@param &lcd pointer to the N5110 library used for the lcd display - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &lcd address of the N5110 library used for the lcd display + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void draw(N5110 &lcd, Gamepad &pad); /** An accessor method that gets the position of all important game objects on screen */ void get_pos(); /** Displays the title screen on the lcd - *@param &lcd pointer to the N5110 library used for the lcd display + *@param &lcd address of the N5110 library used for the lcd display */ void title(N5110 &lcd); /** An accessor method that gets the ycursor value to be used in the menu @@ -69,7 +69,7 @@ */ SHIP set_shipUsed(); /** Displays the ship option in the menu to allow player switch ships - *@param &lcd pointer to the N5110 library used for the lcd display + *@param &lcd address of the N5110 library used for the lcd display */ void ship_select(N5110 &lcd); /** A mutator method that checks the enemies and players health. it resets an enemy if @@ -85,24 +85,20 @@ */ bool dead(); /** Displays the intro to the game - *@param &lcd pointer to the N5110 library used for the lcd display + *@param &lcd address of the N5110 library used for the lcd display */ void intro(N5110 &lcd); /** An accessor method used to get the current number of the two enemies, seeker and shooter, on screen @returns a 2D vector of the enemy numbers with the .x referring to shooters and the .y referring to seekers */ Vector2D get_enemynum(); - - //*** note: add ship width and ship heirgth in place of 6 and 9 to generalize arrays after they are finished - -private: /** A mutator method that updates the shooters projectile position - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void update_shooter_weapon(Gamepad &pad); /** Draws the appropriate ship based on shipUsed (the ship being used) - *@param &lcd pointer to the N5110 library used for the lcd display - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &lcd address of the N5110 library used for the lcd display + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void draw_ship(N5110 &lcd, Gamepad &pad); /** A mutator function that changes ship_width appropriate ship based on shipUsed (the ship being used) @@ -132,35 +128,35 @@ */ bool check_collision1(int xpos1,int width1,int xpos2,int width2); /** Checks if a seeker and the player ship collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void seeker_ship_collision(Gamepad &pad); /** Checks if a shooter and the player ship collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void shooter_ship_collision(Gamepad &pad); /** Checks if a shooter's projectile and the player ship collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void shooterw_ship_collision(Gamepad &pad); /** Checks if the kestrel ships's projectile and the seeker collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void kestrelw_seeker_collision(Gamepad &pad); /** Checks if the Imperions lazer and the seeker collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void imperionw_seeker_collision(Gamepad &pad); /** Checks if the kestrel ships's projectile and the shooter collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void kestrelw_shooter_collision(Gamepad &pad); /** Checks if the Imperions lazer and the shooter collided - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void imperionw_shooter_collision(Gamepad &pad); /** Checks if the orions weapon collided with any enemy - *@param &pad pointer to the gamepad library used to read inputs and send outputs to the gamepad + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ void orionw_collision(Gamepad &pad); /** Gradually increased the difficulty of the game over time @@ -172,11 +168,11 @@ */ int rand_no(); /** Displays a random tip on lcd - *@param &lcd pointer to the N5110 library used for the lcd display + *@param &lcd address of the N5110 library used for the lcd display */ void game_over(N5110 &lcd); /** Displays the points the player has on screen - *@param &lcd pointer to the N5110 library used for the lcd display + *@param &lcd address of the N5110 library used for the lcd display */ void disp_points(N5110 &lcd); /** Checks the seekers health @@ -202,36 +198,34 @@ *@returns the position of the closest enemy */ Vector2D find_closest2(int index); + - // Variables - - Ship _ship; +private: + //_______________Private-Variables__________________________________________ + Ship _ship; // The ship class Weapons _weapons; Menu _menu; Enemy _enemy; Health _health; Lore _lore; - Vector2D _joystick; - Direction _d; - SHIP _shipUsed; - int _ycursor; - int _shipno; - int _score; - int _shno; - int _shipWidth; - int _shipHeight; - Vector2D _shipPos; - Vector2D _shooterPos[3]; - Vector2D _shooterWPos[3]; - Vector2D _seekerPos[3]; - Vector2D _coloc; - bool _dead; - int _times_run; - int _no_shooters; - int _no_seekers; - bool _intro; - float _wait_time; + Vector2D _joystick; // a vector containing the joystick values + Direction _d; // direction of the joystick, N,S,E, or W + SHIP _shipUsed; // a variable in of type enum SHIP that contains the ship being used by the player + int _ycursor; // the _ycursor value that indicates where the rectangular cursor is drawn in the menu + int _score; // the players score + int _shipWidth; // the ship's width + int _shipHeight; // the ship's height + Vector2D _shipPos; // the ships position + Vector2D _shooterPos[3]; // an array of all the shooter positions + Vector2D _shooterWPos[3]; // an array of all the shooter weapon positions + Vector2D _seekerPos[3]; // an array of the seeker position + bool _dead; // true if player dies else false + int _times_run; // the amount of times the game loop is run + int _no_shooters; // the anount of shooters + int _no_seekers; // the amount of seeker + bool _intro; // true if intro has been shown else false + float _wait_time; // amount of time before increasing difficulty };