ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19zf

Dependencies:   mbed

shot/shot.h

Committer:
el19zf
Date:
2020-04-14
Revision:
5:6774b7272e85
Parent:
4:b12a49f0b730
Child:
6:dce38fe4e092

File content as of revision 5:6774b7272e85:

#ifndef SHOT_H
#define SHOT_H

#include "mbed.h"
#include "Gamepad.h"
#include "N5110.h"
#include <vector>

/** shot class
    @set several kinds of shot and come from all around
    @author Zeyu Feng
    @13 April 2020
   */
struct shot_posandtype{
    int x;
    int y;
    int type;
    int dir;
};

class shot {
 
public:  
    //constructor
    shot();
    //destructor
    ~shot();
    
    void init(N5110 &lcd);
    
    int rand_dir();//random direction of shot
    
    int rand_type();//give a random number from 0 - 3
    
    void gen_shot();//3 types direction 
    
    void update(N5110 &lcd);
    
    void draw(N5110 &lcd);
    
    
private:
    
    std::vector<shot_posandtype> _p;
    
    
    
};
#endif