Laila Al Badwawi 200906179 SpaceInvaders I declare this my own independent work and understand the university rules on plagiarism.
Dependencies: mbed
Diff: Spaceship/Spaceship.h
- Revision:
- 105:b206078335a3
- Parent:
- 104:fe20457ef1a9
- Child:
- 131:2084e4a8338f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Spaceship/Spaceship.h Sun May 05 13:17:31 2019 +0000 @@ -0,0 +1,57 @@ +#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 \ No newline at end of file