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
Bullet/bullet.h@99:2fb516e8568d, 2019-05-05 (annotated)
- Committer:
- fy14lkaa
- Date:
- Sun May 05 02:03:17 2019 +0000
- Revision:
- 99:2fb516e8568d
- Parent:
- 98:663e584183bf
added some private members in bullet.h (int get_pos_y(); and int get_pos_x();).; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fy14lkaa | 98:663e584183bf | 1 | |
fy14lkaa | 98:663e584183bf | 2 | |
fy14lkaa | 98:663e584183bf | 3 | |
fy14lkaa | 98:663e584183bf | 4 | |
fy14lkaa | 98:663e584183bf | 5 | |
fy14lkaa | 92:8a1b14488ca5 | 6 | #ifndef BULLET_H |
fy14lkaa | 92:8a1b14488ca5 | 7 | #define BULLET_H |
fy14lkaa | 92:8a1b14488ca5 | 8 | |
fy14lkaa | 92:8a1b14488ca5 | 9 | #include "mbed.h" |
fy14lkaa | 92:8a1b14488ca5 | 10 | #include "N5110.h" |
fy14lkaa | 92:8a1b14488ca5 | 11 | #include "Gamepad.h" |
fy14lkaa | 92:8a1b14488ca5 | 12 | |
fy14lkaa | 98:663e584183bf | 13 | |
fy14lkaa | 92:8a1b14488ca5 | 14 | |
fy14lkaa | 92:8a1b14488ca5 | 15 | |
fy14lkaa | 92:8a1b14488ca5 | 16 | |
fy14lkaa | 98:663e584183bf | 17 | class Bullet |
fy14lkaa | 92:8a1b14488ca5 | 18 | { |
fy14lkaa | 92:8a1b14488ca5 | 19 | public: |
fy14lkaa | 98:663e584183bf | 20 | Bullet(); |
fy14lkaa | 98:663e584183bf | 21 | ~Bullet(); |
fy14lkaa | 92:8a1b14488ca5 | 22 | |
fy14lkaa | 98:663e584183bf | 23 | void init(int x_bullet,int y_bullet, int speed_bullet, int fired_bullet); |
fy14lkaa | 92:8a1b14488ca5 | 24 | void draw(N5110 &lcd); |
fy14lkaa | 98:663e584183bf | 25 | void update(Direction d,float mag); |
fy14lkaa | 98:663e584183bf | 26 | void set_pos(int x, int y); |
fy14lkaa | 99:2fb516e8568d | 27 | |
fy14lkaa | 92:8a1b14488ca5 | 28 | private: |
fy14lkaa | 92:8a1b14488ca5 | 29 | |
fy14lkaa | 92:8a1b14488ca5 | 30 | |
fy14lkaa | 98:663e584183bf | 31 | int _x_bullet; |
fy14lkaa | 98:663e584183bf | 32 | int _y_bullet; |
fy14lkaa | 98:663e584183bf | 33 | |
fy14lkaa | 98:663e584183bf | 34 | int _fired_bullet; |
fy14lkaa | 98:663e584183bf | 35 | |
fy14lkaa | 98:663e584183bf | 36 | int _speed_bullet; |
fy14lkaa | 99:2fb516e8568d | 37 | |
fy14lkaa | 99:2fb516e8568d | 38 | int get_pos_y(); |
fy14lkaa | 99:2fb516e8568d | 39 | |
fy14lkaa | 99:2fb516e8568d | 40 | int get_pos_x(); |
fy14lkaa | 99:2fb516e8568d | 41 | |
fy14lkaa | 98:663e584183bf | 42 | Direction d; |
fy14lkaa | 98:663e584183bf | 43 | float mag; |
fy14lkaa | 98:663e584183bf | 44 | |
fy14lkaa | 92:8a1b14488ca5 | 45 | }; |
fy14lkaa | 92:8a1b14488ca5 | 46 | #endif |