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.
UFO.h
00001 #ifndef UFO_H 00002 #define UFO_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Joystick.h" 00007 #include "Bitmap.h" 00008 /* UFO Class 00009 @Library for UFO object in the spaceship project 00010 @coded by Li Ruofan 00011 @May 2020 00012 */ 00013 class UFO{ 00014 00015 public: 00016 /* Constructor & Destructor */ 00017 UFO(); 00018 00019 ~UFO(); 00020 00021 /* Initiate the position and the size of the UFO 00022 @param the value of horizontal position x (int) 00023 @param the value of vertical position y (int) 00024 @param the columns of UFO image (int) 00025 @param the rows of UFO image (int) 00026 */ 00027 void init(int x,int y,int _width,int _height); 00028 00029 /* Get the position of UFO in lcd 00030 @return the position of UFO in lcd 00031 */ 00032 Vector2D getPos(); 00033 00034 /* Update the position of UFO 00035 */ 00036 void update(); 00037 00038 /* draw the image of the UFO 00039 * @param lcd (N5110) 00040 * @param the value difficulty mode (int) 00041 */ 00042 void draw(N5110 &lcd,int mode); 00043 00044 /** Set the UFO speed 00045 * @param the value of UFO speed 00046 */ 00047 void setSpeed(int speed); 00048 00049 /** Get the speed of the UFO 00050 * @return the value of speed of the UFO (int) 00051 */ 00052 int getSpeed(); 00053 00054 /** Get the blood of the UFO 00055 * @return the blood of the UFO 00056 */ 00057 int getBlood(); 00058 00059 /** Set the blood of the UFO 00060 * @param the blood of the UFO 00061 */ 00062 void setBlood(int harm); 00063 00064 private: 00065 int _x; 00066 int _y; 00067 int _width; 00068 int _height; 00069 int _speed; 00070 int _blood; 00071 00072 }; 00073 #endif
Generated on Wed Jul 13 2022 13:02:18 by
