Laila Al Badwawi 200906179 SpaceInvaders I declare this my own independent work and understand the university rules on plagiarism.
Dependencies: mbed
Alien/Alien.h@28:4786e81ce3e3, 2019-04-20 (annotated)
- Committer:
- fy14lkaa
- Date:
- Sat Apr 20 00:48:05 2019 +0000
- Revision:
- 28:4786e81ce3e3
- Child:
- 51:cb644365d9a3
declared an accessor function [Vector2D get_pos();] to return the position of the bullet.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fy14lkaa | 28:4786e81ce3e3 | 1 | #ifndef Alien_H |
fy14lkaa | 28:4786e81ce3e3 | 2 | #define Alien_H |
fy14lkaa | 28:4786e81ce3e3 | 3 | |
fy14lkaa | 28:4786e81ce3e3 | 4 | |
fy14lkaa | 28:4786e81ce3e3 | 5 | |
fy14lkaa | 28:4786e81ce3e3 | 6 | #include "mbed.h" |
fy14lkaa | 28:4786e81ce3e3 | 7 | #include "Gamepad.h" |
fy14lkaa | 28:4786e81ce3e3 | 8 | #include "N5110.h" |
fy14lkaa | 28:4786e81ce3e3 | 9 | #include "SpaceInvadersEngine.h" |
fy14lkaa | 28:4786e81ce3e3 | 10 | |
fy14lkaa | 28:4786e81ce3e3 | 11 | |
fy14lkaa | 28:4786e81ce3e3 | 12 | class Alien |
fy14lkaa | 28:4786e81ce3e3 | 13 | { |
fy14lkaa | 28:4786e81ce3e3 | 14 | public: |
fy14lkaa | 28:4786e81ce3e3 | 15 | Alien(); |
fy14lkaa | 28:4786e81ce3e3 | 16 | ~Alien(); |
fy14lkaa | 28:4786e81ce3e3 | 17 | |
fy14lkaa | 28:4786e81ce3e3 | 18 | void init(int size,int speed); |
fy14lkaa | 28:4786e81ce3e3 | 19 | void draw(N5110 &lcd); |
fy14lkaa | 28:4786e81ce3e3 | 20 | void update(); |
fy14lkaa | 28:4786e81ce3e3 | 21 | /// accessors and mutators |
fy14lkaa | 28:4786e81ce3e3 | 22 | void set_velocity(Vector2D v); |
fy14lkaa | 28:4786e81ce3e3 | 23 | Vector2D get_velocity(); |
fy14lkaa | 28:4786e81ce3e3 | 24 | Vector2D get_pos(); |
fy14lkaa | 28:4786e81ce3e3 | 25 | void set_pos(Vector2D p); |
fy14lkaa | 28:4786e81ce3e3 | 26 | |
fy14lkaa | 28:4786e81ce3e3 | 27 | private: |
fy14lkaa | 28:4786e81ce3e3 | 28 | |
fy14lkaa | 28:4786e81ce3e3 | 29 | Vector2D _velocity; |
fy14lkaa | 28:4786e81ce3e3 | 30 | int _size; |
fy14lkaa | 28:4786e81ce3e3 | 31 | int _x; |
fy14lkaa | 28:4786e81ce3e3 | 32 | int _y; |
fy14lkaa | 28:4786e81ce3e3 | 33 | }; |
fy14lkaa | 28:4786e81ce3e3 | 34 | #endif |