ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18zc2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bullet.h Source File

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