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
spase_ship/space_ship.h
- Committer:
- fy14lkaa
- Date:
- 2019-04-22
- Revision:
- 51:cb644365d9a3
- Parent:
- 50:f538885a788b
- Child:
- 52:84e89553c606
File content as of revision 51:cb644365d9a3:
#ifndef SPACE_SHIP_H #define SPACE_SHIP_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "SpaceInvadersEngine.h" #include "Alien.h" #include "bullet.h" /** space_ship class @brief class for spaceship @version 1.0 @author Laila Al Badwawi @date April 2019 */ class space_ship { public: // constructors //string Variables of this type are able to store sequences of characters, //such as words or sentences. /** *@constucter creat a defult a spaceship */ space_ship(); //constructor ~space_ship(); //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 space_ship *@param x @details the x-cooridante of space_shipin intger *@param height @details the height of space_ship in integer *@param width @details the widthof space_ship in integer */ void init(int x,int height,int width); // a mutotor method used to set the following variables (x-cooridante, height and width). void draw(N5110 &lcd); // a mutotor method used to set the the drawing variable to draw the space ship by using both N5110&lcd libraries. void update(Direction d,float mag); // a mutotor method used to update the direction of the spaceship and its speed(magniutde). void add_score(); // a mutotor method used to add the scores of the spaceship.everytime the buliet fires the alien so it inceased the number of scores by 1. /*accessors An accessor method defined as methods which help users to read the value of a member variable. Their names are usually prefixed with get_ to make this clearer to the user. */ int get_score(); // an accessor method used to return the number of tne scores. Vector2D get_pos(); // an accessor method used to return the position of the spaceship in vector2D. private: //member variables //parameters /*@param _height */ int _height; // declation of a variable member _width which shows the height of the spaceship. /*@param _wedith */ int _width; // declation of a variable member _width which shows the width of the spaceship. //@param //_x int _x; //declation of a variable member _width which shows the x-cooridante of the spaceship. /*@param _y */ int _y; //declation of a variable member _width which shows the y-cooridante of the spaceship. /*@param _speed */ int _speed; // declation of a variable member _width which shows the speed of the spaceship. /*@param _score */ int _score; // declation of a variable member _width which shows the speed of the spaceship. }; #endif