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
Projectile/Projectile.h@17:cb39d9fa08dc, 2019-04-27 (annotated)
- Committer:
- el17mcd
- Date:
- Sat Apr 27 17:43:46 2019 +0000
- Revision:
- 17:cb39d9fa08dc
- Parent:
- 16:a2c945279b79
- Child:
- 21:44e87d88afe2
! Stylistic changes made to code so it conforms to google c++ guide. Beginning of inline commenting of source code.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17mcd | 7:a3ccabdebe2e | 1 | #ifndef PROJECTILE_H |
| el17mcd | 7:a3ccabdebe2e | 2 | #define PROJECTILE_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 Projectile |
| el17mcd | 7:a3ccabdebe2e | 10 | { |
| el17mcd | 16:a2c945279b79 | 11 | |
| el17mcd | 7:a3ccabdebe2e | 12 | public: |
| el17mcd | 7:a3ccabdebe2e | 13 | |
| el17mcd | 17:cb39d9fa08dc | 14 | Projectile(); |
| el17mcd | 17:cb39d9fa08dc | 15 | ~Projectile(); |
| el17mcd | 16:a2c945279b79 | 16 | |
| el17mcd | 17:cb39d9fa08dc | 17 | // Accessors |
| el17mcd | 17:cb39d9fa08dc | 18 | int get_position_x(); |
| el17mcd | 17:cb39d9fa08dc | 19 | int get_position_y(); |
| el17mcd | 17:cb39d9fa08dc | 20 | int get_hitbox(int i); |
| el17mcd | 17:cb39d9fa08dc | 21 | // Mutators |
| el17mcd | 17:cb39d9fa08dc | 22 | void set_launch_parameters(int x, int y, float ang, float vel, |
| el17mcd | 17:cb39d9fa08dc | 23 | float grav, float wind); |
| el17mcd | 17:cb39d9fa08dc | 24 | // Other Methods |
| el17mcd | 17:cb39d9fa08dc | 25 | void generate_hitbox(); |
| el17mcd | 17:cb39d9fa08dc | 26 | void update_flight(); |
| el17mcd | 17:cb39d9fa08dc | 27 | bool check_boundaries(); |
| el17mcd | 7:a3ccabdebe2e | 28 | |
| el17mcd | 7:a3ccabdebe2e | 29 | private: |
| el17mcd | 7:a3ccabdebe2e | 30 | |
| el17mcd | 17:cb39d9fa08dc | 31 | int _position_x; |
| el17mcd | 17:cb39d9fa08dc | 32 | int _position_y; |
| el17mcd | 17:cb39d9fa08dc | 33 | int _hitbox[5]; |
| el17mcd | 17:cb39d9fa08dc | 34 | int _init_x; |
| el17mcd | 17:cb39d9fa08dc | 35 | int _init_y; |
| el17mcd | 17:cb39d9fa08dc | 36 | float _time; |
| el17mcd | 17:cb39d9fa08dc | 37 | float _lnch_ang; |
| el17mcd | 17:cb39d9fa08dc | 38 | float _init_vel; |
| el17mcd | 17:cb39d9fa08dc | 39 | float _grav_acc; |
| el17mcd | 17:cb39d9fa08dc | 40 | float _wind_acc; |
| el17mcd | 7:a3ccabdebe2e | 41 | }; |
| el17mcd | 7:a3ccabdebe2e | 42 | |
| el17mcd | 7:a3ccabdebe2e | 43 | #endif // PROJECTILE_H |