Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
spaceship/spaceship.h@104:fe20457ef1a9, 2019-05-05 (annotated)
- Committer:
- fy14lkaa
- Date:
- Sun May 05 13:13:55 2019 +0000
- Revision:
- 104:fe20457ef1a9
- Parent:
- 103:cb05154d5025
added some public members in Spacesship.h such as ; void set_pos(int x, int y);; int get_pos_y();; int get_pos_x();
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fy14lkaa | 104:fe20457ef1a9 | 1 | #ifndef SPACESHIP_H |
fy14lkaa | 104:fe20457ef1a9 | 2 | #define SPACESHIP_H |
fy14lkaa | 34:4bff5515060e | 3 | |
fy14lkaa | 34:4bff5515060e | 4 | #include "mbed.h" |
fy14lkaa | 34:4bff5515060e | 5 | #include "N5110.h" |
fy14lkaa | 34:4bff5515060e | 6 | #include "Gamepad.h" |
fy14lkaa | 35:261df7c3a3fb | 7 | #include "Alien.h" |
fy14lkaa | 104:fe20457ef1a9 | 8 | #include "Bullet.h" |
fy14lkaa | 51:cb644365d9a3 | 9 | |
fy14lkaa | 51:cb644365d9a3 | 10 | |
fy14lkaa | 104:fe20457ef1a9 | 11 | /*int spaceship_2[10][12]= { |
fy14lkaa | 104:fe20457ef1a9 | 12 | {0,0,0,0,0,0,0,0,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 13 | {0,0,0,1,1,0,0,0,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 14 | {0,0,0,1,1,0,0,0,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 15 | {0,1,1,1,1,1,1,1,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 16 | {0,1,1,1,1,1,1,1,1,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 17 | {0,1,1,1,1,1,1,1,1,1,1,0}, |
fy14lkaa | 104:fe20457ef1a9 | 18 | {0,1,1,1,1,1,1,1,1,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 19 | {0,1,1,1,1,1,1,1,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 20 | {0,0,0,1,1,0,0,0,0,0,0,0}, |
fy14lkaa | 104:fe20457ef1a9 | 21 | {0,0,0,1,1,0,0,0,0,0,0,0}, |
fy14lkaa | 51:cb644365d9a3 | 22 | |
fy14lkaa | 104:fe20457ef1a9 | 23 | }; |
fy14lkaa | 104:fe20457ef1a9 | 24 | */ |
fy14lkaa | 104:fe20457ef1a9 | 25 | |
fy14lkaa | 104:fe20457ef1a9 | 26 | class Spaceship |
fy14lkaa | 104:fe20457ef1a9 | 27 | { |
fy14lkaa | 104:fe20457ef1a9 | 28 | |
fy14lkaa | 104:fe20457ef1a9 | 29 | public: |
fy14lkaa | 104:fe20457ef1a9 | 30 | |
fy14lkaa | 104:fe20457ef1a9 | 31 | Spaceship(); |
fy14lkaa | 104:fe20457ef1a9 | 32 | ~Spaceship(); |
fy14lkaa | 51:cb644365d9a3 | 33 | |
fy14lkaa | 50:f538885a788b | 34 | |
fy14lkaa | 104:fe20457ef1a9 | 35 | void init(int x_spaceship,int y_spaceship, int speed_spaceship); |
fy14lkaa | 104:fe20457ef1a9 | 36 | void draw(N5110 &lcd); |
fy14lkaa | 104:fe20457ef1a9 | 37 | void update(Direction d,float mag); |
fy14lkaa | 104:fe20457ef1a9 | 38 | void set_pos(int x, int y); |
fy14lkaa | 104:fe20457ef1a9 | 39 | int get_pos_y(); |
fy14lkaa | 104:fe20457ef1a9 | 40 | int get_pos_x(); |
fy14lkaa | 104:fe20457ef1a9 | 41 | //void read_input(Gamepad &pad); |
fy14lkaa | 104:fe20457ef1a9 | 42 | //void add_score(); |
fy14lkaa | 104:fe20457ef1a9 | 43 | //int get_score(); |
fy14lkaa | 50:f538885a788b | 44 | |
fy14lkaa | 51:cb644365d9a3 | 45 | |
fy14lkaa | 44:0b0d31dc3d05 | 46 | private: |
fy14lkaa | 44:0b0d31dc3d05 | 47 | |
fy14lkaa | 104:fe20457ef1a9 | 48 | |
fy14lkaa | 104:fe20457ef1a9 | 49 | int _x_spaceship; |
fy14lkaa | 104:fe20457ef1a9 | 50 | int _y_spaceship; |
fy14lkaa | 104:fe20457ef1a9 | 51 | int _speed_spaceship; |
fy14lkaa | 50:f538885a788b | 52 | |
fy14lkaa | 104:fe20457ef1a9 | 53 | //int _score; |
fy14lkaa | 104:fe20457ef1a9 | 54 | Direction d; |
fy14lkaa | 104:fe20457ef1a9 | 55 | float mag; |
fy14lkaa | 104:fe20457ef1a9 | 56 | }; |
fy14lkaa | 104:fe20457ef1a9 | 57 | #endif |