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.
shot.h
00001 #ifndef BULLET_H 00002 #define BULLET_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Joystick.h" 00007 #include "Bitmap.h" 00008 /** Bullet Class 00009 @brief Library for one of the objects bullet of star war, University of Leeds 00010 @author Huang Xinjie 00011 @date May 2019 00012 */ 00013 00014 class Bullet{ 00015 00016 public: 00017 /** Constructor */ 00018 Bullet(); 00019 00020 /** Destructor */ 00021 ~Bullet(); 00022 00023 /** Initialize the position and the size of the bullet 00024 * @param the value of horizontal position x (int) 00025 * @param the value of vertical position x (int) 00026 * @param the number of columns of bullet image (int) 00027 * @param the number of rows of bullet image (int) 00028 */ 00029 void init(int x,int y,int sizeX,int sizeY); 00030 00031 /** draw the image of the bullet 00032 * @param lcd (N5110) 00033 */ 00034 void draw(N5110 &lcd); //draw the bullet 00035 00036 /** Update the position of the bullet */ 00037 void update(); 00038 00039 /** get the position of bullet in the lcd 00040 * @return the current postion of bullet 00041 */ 00042 Vector2D getPos(); 00043 private: 00044 int _x; 00045 int _y; 00046 int _width; 00047 int _height; 00048 }; 00049 #endif
Generated on Wed Jul 13 2022 13:02:18 by
