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:
- 52:29772e31a620
- Parent:
- 51:2231e2e141b9
- Child:
- 53:3fdc4486f672
--- a/RosenEngine/RosenEngine.h Thu May 09 08:42:25 2019 +0000 +++ b/RosenEngine/RosenEngine.h Thu May 09 13:22:45 2019 +0000 @@ -65,9 +65,8 @@ int get_ycursor(); /** A mutator method used to set the ship being used in the game. * either the kestrel, the imperion or the orion - *@returns the ship being used */ - SHIP set_shipUsed(); + void set_shipUsed(); /** Displays the ship option in the menu to allow player switch ships *@param &lcd address of the N5110 library used for the lcd display */ @@ -88,26 +87,10 @@ *@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(); - /** A mutator method that updates the shooters projectile position - *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad + /** An accessor method that gets the ships position + *@returns the ships position */ - void update_shooter_weapon(Gamepad &pad); - /** Draws the appropriate ship based on shipUsed (the ship being used) - *@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) - */ - void set_ship_size(); - /** A mutator function that changes the players score - *@param points, the amount of points the player scored - */ - void score(int points); + Vector2D get_shipPos(); /** Checks for a collision between two 2D objects *@param xpos1, the x co-ordinate of the first object *@param ypos1, the y co-ordinate of the first object @@ -127,6 +110,29 @@ *@param width2, the width of the second object */ bool check_collision1(int xpos1,int width1,int xpos2,int width2); + +private: + //_____________________private-Methods________________________________________________________ + /** 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(); + /** A mutator method that updates the ships weapons + *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad + */ + void update_ship_weapon(Gamepad &pad); + /** Draws the appropriate ship based on shipUsed (the ship being used) + *@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) + */ + void set_ship_size(); + /** A mutator function that changes the players score + *@param points, the amount of points the player scored + */ + void score(int points); /** Checks if a seeker and the player ship collided *@param &pad address of the gamepad library used to read inputs and send outputs to the gamepad */ @@ -198,17 +204,13 @@ *@returns the position of the closest enemy */ Vector2D find_closest2(int index); - - - -private: //_______________Private-Variables__________________________________________ - Ship _ship; // The ship class - Weapons _weapons; - Menu _menu; - Enemy _enemy; - Health _health; - Lore _lore; + Ship _ship; // The ship class object + Weapons _weapons; // The weapon class object + Menu _menu; // The menu class object + Enemy _enemy; // The enemy class object + Health _health; // The health class object + Lore _lore; // The lore class object 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