Li Ruofan 201199450
Dependencies: mbed Gamepad Joystick
Diff: UFO/UFO.h
- Revision:
- 3:cf9fead9c3f4
- Child:
- 5:e3a9f0548922
diff -r 5969f78a25ba -r cf9fead9c3f4 UFO/UFO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UFO/UFO.h Thu May 14 13:12:28 2020 +0000 @@ -0,0 +1,73 @@ +#ifndef UFO_H +#define UFO_H + +#include "mbed.h" +#include "N5110.h" +#include "Joystick.h" +#include "Bitmap.h" +/* UFO Class +@Library for UFO object in the spaceship project +@coded by Li Ruofan +@May 2020 +*/ +class UFO{ + +public: + /* Constructor & Destructor */ + UFO(int level); + + ~UFO(); + + /* Initiate the position and the size of the UFO + @param the value of horizontal position x (int) + @param the value of vertical position y (int) + @param the columns of UFO image (int) + @param the rows of UFO image (int) + */ + void init(int x,int y,int _sizeX,int _sizeY); + + /* Get the position of UFO in lcd + @return the position of UFO in lcd + */ + Vector2D getPos(); + + /* Update the position of UFO + */ + void update(); + + /* draw the image of the UFO + * @param lcd (N5110) + * @param the value difficulty mode (int) + */ + void draw(N5110 &lcd,int mode); + + /** Set the UFO speed + * @param the value of UFO speed + */ + void setSpeed(int speed); + + /** Get the speed of the UFO + * @return the value of speed of the UFO (int) + */ + int getSpeed(); + + /** Get the blood of the UFO + * @return the blood of the UFO + */ + int getBlood(); + + /** Set the blood of the UFO + * @param the blood of the UFO + */ + void setBlood(int harm); + +private: + int _x; + int _y; + int _sizeX; + int _sizeY; + int _speed; + int _blood; + +}; +#endif \ No newline at end of file