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.
Missiles/Missiles.h@8:d1c04f0e4890, 2019-05-11 (annotated)
- Committer:
- el17ttds
- Date:
- Sat May 11 08:23:54 2019 +0000
- Revision:
- 8:d1c04f0e4890
- Child:
- 9:3a0194c87afe
Full game.; Unfinished menu, tone glitch, score doesn't print, ammo and health to be displayed
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17ttds | 8:d1c04f0e4890 | 1 | #include "mbed.h" |
| el17ttds | 8:d1c04f0e4890 | 2 | #include "N5110.h" |
| el17ttds | 8:d1c04f0e4890 | 3 | #include "Gamepad.h" |
| el17ttds | 8:d1c04f0e4890 | 4 | |
| el17ttds | 8:d1c04f0e4890 | 5 | class Missiles { |
| el17ttds | 8:d1c04f0e4890 | 6 | |
| el17ttds | 8:d1c04f0e4890 | 7 | public: |
| el17ttds | 8:d1c04f0e4890 | 8 | Missiles(); |
| el17ttds | 8:d1c04f0e4890 | 9 | void init(); |
| el17ttds | 8:d1c04f0e4890 | 10 | void write(int pix_x, int pix_y, Direction d, bool Apressed, bool Bpressed, int map_x, int map_y, bool m1_hit, bool m2_hit, bool m3_hit, Gamepad &pad, N5110 &lcd); |
| el17ttds | 8:d1c04f0e4890 | 11 | void draw(N5110 &lcd); |
| el17ttds | 8:d1c04f0e4890 | 12 | Vector2D get_m1_pos(); |
| el17ttds | 8:d1c04f0e4890 | 13 | Vector2D get_m2_pos(); |
| el17ttds | 8:d1c04f0e4890 | 14 | Vector2D get_m3_pos(); |
| el17ttds | 8:d1c04f0e4890 | 15 | |
| el17ttds | 8:d1c04f0e4890 | 16 | private: |
| el17ttds | 8:d1c04f0e4890 | 17 | void check_hit(); |
| el17ttds | 8:d1c04f0e4890 | 18 | void move_missile(); |
| el17ttds | 8:d1c04f0e4890 | 19 | void set_forward(); |
| el17ttds | 8:d1c04f0e4890 | 20 | void set_back(); |
| el17ttds | 8:d1c04f0e4890 | 21 | void direction(); |
| el17ttds | 8:d1c04f0e4890 | 22 | void check_collision_wall(); |
| el17ttds | 8:d1c04f0e4890 | 23 | int frame_counter1; |
| el17ttds | 8:d1c04f0e4890 | 24 | int frame_counter2; |
| el17ttds | 8:d1c04f0e4890 | 25 | int frame_counter3; |
| el17ttds | 8:d1c04f0e4890 | 26 | int reload_rate; |
| el17ttds | 8:d1c04f0e4890 | 27 | int _xStart; |
| el17ttds | 8:d1c04f0e4890 | 28 | int _yStart; |
| el17ttds | 8:d1c04f0e4890 | 29 | int _speed; |
| el17ttds | 8:d1c04f0e4890 | 30 | float _changex; |
| el17ttds | 8:d1c04f0e4890 | 31 | float _changey; |
| el17ttds | 8:d1c04f0e4890 | 32 | |
| el17ttds | 8:d1c04f0e4890 | 33 | Direction _d; |
| el17ttds | 8:d1c04f0e4890 | 34 | bool _Apressed; |
| el17ttds | 8:d1c04f0e4890 | 35 | bool _Bpressed; |
| el17ttds | 8:d1c04f0e4890 | 36 | |
| el17ttds | 8:d1c04f0e4890 | 37 | int _pix_x; |
| el17ttds | 8:d1c04f0e4890 | 38 | int _pix_y; |
| el17ttds | 8:d1c04f0e4890 | 39 | int _map_x; |
| el17ttds | 8:d1c04f0e4890 | 40 | int _map_y; |
| el17ttds | 8:d1c04f0e4890 | 41 | |
| el17ttds | 8:d1c04f0e4890 | 42 | bool _m1_hit; |
| el17ttds | 8:d1c04f0e4890 | 43 | bool _m1; |
| el17ttds | 8:d1c04f0e4890 | 44 | int _m1x; |
| el17ttds | 8:d1c04f0e4890 | 45 | int _m1y; |
| el17ttds | 8:d1c04f0e4890 | 46 | float _changex1; |
| el17ttds | 8:d1c04f0e4890 | 47 | float _changey1; |
| el17ttds | 8:d1c04f0e4890 | 48 | bool _m2_hit; |
| el17ttds | 8:d1c04f0e4890 | 49 | bool _m2; |
| el17ttds | 8:d1c04f0e4890 | 50 | int _m2x; |
| el17ttds | 8:d1c04f0e4890 | 51 | int _m2y; |
| el17ttds | 8:d1c04f0e4890 | 52 | float _changex2; |
| el17ttds | 8:d1c04f0e4890 | 53 | float _changey2; |
| el17ttds | 8:d1c04f0e4890 | 54 | bool _m3_hit; |
| el17ttds | 8:d1c04f0e4890 | 55 | bool _m3; |
| el17ttds | 8:d1c04f0e4890 | 56 | int _m3x; |
| el17ttds | 8:d1c04f0e4890 | 57 | int _m3y; |
| el17ttds | 8:d1c04f0e4890 | 58 | float _changex3; |
| el17ttds | 8:d1c04f0e4890 | 59 | float _changey3; |
| el17ttds | 8:d1c04f0e4890 | 60 | }; |