ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

AlienBullet/AlienBullet.h

Committer:
josh_ohara
Date:
2020-05-17
Revision:
29:1615c1cffa6f
Parent:
27:eb755a345b1f
Child:
30:4504b5dd47d1

File content as of revision 29:1615c1cffa6f:

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"

class AlienBullet
{    
public:
    AlienBullet();                                                              
    ~AlienBullet();
    void init(int x, int y);                                                    //initialises objects and sets private variables
    void render(N5110 &lcd);                                                    //draws bullet 
    void update();                                                              //udpdates private variables
    //accessors and mutators
    Vector2D get_position();                                                    //returns the x and y position of the bullet
    void set_hit(bool x);                                                       //sets the hit value of the bullet
    bool get_hit();                                                             //returns the hit value of the bullet
    
private:
    int _y;                                                                     //y position of the bullet
    int _x;                                                                     //x position of the bullet
    int _speed;                                                                 //speed of the bullet (y direction)
    bool _hit;                                                                  //variable to show if bullet has caused a hit, functions the same as the life variable of the ship but logically opposite
    
};