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
Bullet.h
00001 #ifndef Bullet_H 00002 #define Bullet_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 #include "Board.h" 00008 00009 /** Bullet Class 00010 @author Chen Zirui, University of Leeds 00011 @brief Bullet data and its functions list,initialisation,drawing,updating,positing setting and speed reading 00012 @date May 2020 00013 */ 00014 class Bullet 00015 { 00016 00017 public: 00018 /**inialisation */ 00019 void init(int x,int size,int speed,int height); //initial datas of bullet 00020 /**draw a bullet*/ 00021 void draw(N5110 &lcd); 00022 /**update data*/ 00023 void update(N5110 &lcd); //update bullet position 00024 /** set velocity */ 00025 void set_velocity(Vector2D v); 00026 /**speed data reading */ 00027 Vector2D get_velocity(); 00028 /**position reading */ 00029 Vector2D get_pos(); 00030 /**position setting */ 00031 void set_pos(Vector2D p); 00032 00033 private: 00034 // all parameters about bullet 00035 Vector2D _velocity; 00036 int _size; 00037 int _x; 00038 int _y; 00039 float X; 00040 float Y; 00041 00042 }; 00043 #endif
Generated on Wed Jul 13 2022 04:23:58 by
1.7.2