Nemesis game, friendly
Diff: Friendly.h
- Revision:
- 10:b856d73db923
- Parent:
- 9:3c411d37d390
- Child:
- 11:4c4a0fe18ac2
--- a/Friendly.h Mon May 01 13:01:20 2017 +0000 +++ b/Friendly.h Tue May 02 22:12:52 2017 +0000 @@ -8,22 +8,69 @@ class Friendly { public: - + + /// Constructor and destructor: Friendly(); ~Friendly(); + + + //////////////////////////////// + //////// PUBLIC METHODS + //////////////////////////////// + + + /** Initialize Friendly + * + * Initializes friendly ship x & y positions. + */ void init(); + + + /** Draw Friendly + * + * Draws the friendly ship onto the LCD, in accordance with the parameters initialized in the "init" method. + */ void draw(N5110 &lcd); + + + /** Update Friendly + * + * Updates the friendly ship's x and y position. X and y positions are altered by adding/subtracting speeds, + * which depend on the direction (d) of the analog stick. The speed is defined as the magnitude of the movement + * of the analog stick multiplied by an arbitrary number (set as 4). + * @param d - direction of analog stick + * @param mag - magnitude of movement of analog stick + */ void update(Direction d,float mag); + + + /** Check Friendly Position + * + * Ensures the friendly ship does not go out of bounds (off screen or into the stats bar) by limiting its x and + * y positions. + */ + void check_pos(); + + + /** Get Friendly Position + * + * Obtains the position (x and y coordinates) of the friendly ship at any given time, into a two-dimensional vector. + * @returns p - the Vector2D of the parameters + */ Vector2D get_pos(); private: - - int _height; - int _width; + + + //////////////////////////////// + //////// PRIVATE VARIABLES + //////////////////////////////// + + int _speed; + + /// Integer variables to store the x and y coordinates of the friendly ship: int _x; int _y; - int _speed; - int _score; }; #endif \ No newline at end of file