ELEC2645 (2018/19) / Mbed 2 deprecated fy14lkaa

Dependencies:   mbed

spaceship/spaceship.h

Committer:
fy14lkaa
Date:
2019-05-05
Revision:
104:fe20457ef1a9
Parent:
103:cb05154d5025

File content as of revision 104:fe20457ef1a9:

#ifndef SPACESHIP_H
#define SPACESHIP_H

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


/*int spaceship_2[10][12]= {
    {0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,1,1,0,0,0,0,0,0,0},
    {0,0,0,1,1,0,0,0,0,0,0,0},
    {0,1,1,1,1,1,1,1,0,0,0,0},
    {0,1,1,1,1,1,1,1,1,0,0,0},
    {0,1,1,1,1,1,1,1,1,1,1,0},
    {0,1,1,1,1,1,1,1,1,0,0,0},
    {0,1,1,1,1,1,1,1,0,0,0,0},
    {0,0,0,1,1,0,0,0,0,0,0,0},
    {0,0,0,1,1,0,0,0,0,0,0,0},

};
*/

class Spaceship
{

public:

    Spaceship();
    ~Spaceship();


    void init(int x_spaceship,int y_spaceship, int speed_spaceship);
    void draw(N5110 &lcd);
    void update(Direction d,float mag);
    void set_pos(int x, int y);
    int  get_pos_y();
    int  get_pos_x();
    //void read_input(Gamepad &pad);
    //void add_score();
    //int get_score();


private:

   
    int _x_spaceship;
    int _y_spaceship;
    int _speed_spaceship;

    //int _score;
    Direction d;
    float mag;
};
#endif