Laila Al Badwawi 200906179 SpaceInvaders I declare this my own independent work and understand the university rules on plagiarism.
Dependencies: mbed
Diff: Alien/Alien.h
- Revision:
- 51:cb644365d9a3
- Parent:
- 28:4786e81ce3e3
- Child:
- 52:84e89553c606
--- a/Alien/Alien.h Mon Apr 22 13:17:23 2019 +0000 +++ b/Alien/Alien.h Mon Apr 22 14:27:24 2019 +0000 @@ -8,27 +8,99 @@ #include "N5110.h" #include "SpaceInvadersEngine.h" +/** Alien class +@brief class for spaceship +@version 1.0 +@author Laila Al Badwawi +@date April 2019 +*/ class Alien { public: - Alien(); - ~Alien(); + // constructors + //string Variables of this type are able to store sequences of characters, + //such as words or sentences. + /** + *@constucter creat a defult Alien + */ + + + Alien(); //constructor + + ~Alien(); //descontractor + +/*mutators + //mutator methods defined as methods which advice the users of the class + //to change the value of a member variable in a controlled manner. + Their names are usually pre-fixed with set_ to make this behaviour clear.*/ + + /** + *@brief initialise an identity for the Alien + *@param size @details size of Alien in intger + *@param speed @details the speed of Alien in integer + */ void init(int size,int speed); + /** + *@brief drawing the Alien + *@param draw @details drawing the Alien by using N5110&lcd librarieas + **/ + void draw(N5110 &lcd); + + /** + *@brief updating the position of the Alien + *@param update @details update the position of the Alien. + **/ void update(); - /// accessors and mutators + + /** + *@brief sitting up the velocity the of the Alien + *@param _velocity @details set the velocity the of the Alien in Vector2D + **/ + void set_velocity(Vector2D v); + + /** + *@brief sitting up the position the of the Alien + *@param _pos @details set the position the of the Alien in Vector2D + **/ + void set_pos(Vector2D p); + /** + *@brief sitting up the velocity the of the Alien + *@return the velocity of the Alien in Vector2D + **/ + Vector2D get_velocity(); + /** + *@brief sitting up the position the of the Alien + *@return the postion of the Alien in Vector2D + **/ + Vector2D get_pos(); - void set_pos(Vector2D p); - + private: +//member variables +//parameters - Vector2D _velocity; - int _size; - int _x; - int _y; +/*@param + _velocity + */ + Vector2D _velocity; // declation of a variable member _velocity which shows the velocity of the Alien in Vector2D. +/*@param +_size + */ + int _size; // declation of a variable member _size which shows the size of the Alien. +/*@param +_x + */ + + int _x; ////declation of a variable member _x which shows the x-cooridante of the Alien. + +/*@param +_y + */ + int _y; //declation of a variable member _y which shows the y-cooridante of the Alien. }; #endif \ No newline at end of file