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
TankL/TankL.h@7:a3ccabdebe2e, 2019-04-09 (annotated)
- Committer:
- el17mcd
- Date:
- Tue Apr 09 17:09:29 2019 +0000
- Revision:
- 7:a3ccabdebe2e
- Child:
- 10:d4fb12e9e7cd
! Hit detection mechanic implemented with separate classes.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17mcd | 7:a3ccabdebe2e | 1 | #ifndef TANKL_H |
el17mcd | 7:a3ccabdebe2e | 2 | #define TANKL_H |
el17mcd | 7:a3ccabdebe2e | 3 | |
el17mcd | 7:a3ccabdebe2e | 4 | #include "mbed.h" |
el17mcd | 7:a3ccabdebe2e | 5 | #include "N5110.h" |
el17mcd | 7:a3ccabdebe2e | 6 | #include "Gamepad.h" |
el17mcd | 7:a3ccabdebe2e | 7 | |
el17mcd | 7:a3ccabdebe2e | 8 | |
el17mcd | 7:a3ccabdebe2e | 9 | class TankL |
el17mcd | 7:a3ccabdebe2e | 10 | { |
el17mcd | 7:a3ccabdebe2e | 11 | public: |
el17mcd | 7:a3ccabdebe2e | 12 | |
el17mcd | 7:a3ccabdebe2e | 13 | void draw(N5110 &lcd); |
el17mcd | 7:a3ccabdebe2e | 14 | void set_position(int x, int y); |
el17mcd | 7:a3ccabdebe2e | 15 | int get_position_x(); |
el17mcd | 7:a3ccabdebe2e | 16 | int get_position_y(); |
el17mcd | 7:a3ccabdebe2e | 17 | int get_hitbox(int i); |
el17mcd | 7:a3ccabdebe2e | 18 | void generate_hitbox(); |
el17mcd | 7:a3ccabdebe2e | 19 | void set_health(int h); |
el17mcd | 7:a3ccabdebe2e | 20 | void lose_health(); |
el17mcd | 7:a3ccabdebe2e | 21 | |
el17mcd | 7:a3ccabdebe2e | 22 | private: |
el17mcd | 7:a3ccabdebe2e | 23 | |
el17mcd | 7:a3ccabdebe2e | 24 | int _position_x; |
el17mcd | 7:a3ccabdebe2e | 25 | int _position_y; |
el17mcd | 7:a3ccabdebe2e | 26 | int _hitbox[40]; |
el17mcd | 7:a3ccabdebe2e | 27 | int _health; |
el17mcd | 7:a3ccabdebe2e | 28 | }; |
el17mcd | 7:a3ccabdebe2e | 29 | |
el17mcd | 7:a3ccabdebe2e | 30 | #endif // TANKL_H |