Chen Zirui Project 201235448

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 
00019     void init(int x,int size,int speed,int height);              //initial datas of bullet
00020     void draw(N5110 &lcd);                                       //draw a bullet
00021     void update(N5110 &lcd);                                     //ubdate bullet position
00022     void set_velocity(Vector2D v);                               //velocity setting
00023     Vector2D get_velocity();                                     //speed data reading
00024     Vector2D get_pos();                                          //position reading
00025     void set_pos(Vector2D p);                                    //position setting
00026     
00027 private:
00028     // all parameters about bullet
00029     Vector2D _velocity;
00030     int _size;
00031     int _x;
00032     int _y;
00033     float X;
00034     float Y;
00035    
00036 };
00037 #endif