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:
- 95:1b43f9c332bc
- Parent:
- 92:8a1b14488ca5
- Child:
- 127:8bd8cf136f19
--- a/Alien/Alien.h Sun May 05 01:32:13 2019 +0000 +++ b/Alien/Alien.h Sun May 05 01:38:30 2019 +0000 @@ -6,105 +6,27 @@ #include "mbed.h" #include "Gamepad.h" #include "N5110.h" -#include "SpaceInvadersEngine.h" - -/** Alien class -@brief class for spaceship -@version 1.0 -@author Laila Al Badwawi -@date April 2019 -*/ +#include "SpaceEngine.h" class Alien { - public: - // 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(); //destructor - - -/*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 - **/ - +public: + Alien(); + ~Alien(); + + + void init(int x_alien,int y_alien, int speed_alien); void draw(N5110 &lcd); - - /** - *@brief updating the position of the Alien - *@param update @details update the position of the Alien. - **/ - void update(); - - /** - *@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 update(Direction d,float mag); private: -//member variables -//parameters - - /*@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. - int y_Alien; - int x_Alien; + int _x_alien; + //int _alien[12][10]; + int _y_alien; + int _speed_alien; + Direction d; + float mag; }; #endif \ No newline at end of file