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
TanksEngine/TanksEngine.h
- Committer:
- el17mcd
- Date:
- 2019-04-17
- Revision:
- 13:feadff02d3f7
- Parent:
- 12:9e6d5d0a0c82
- Child:
- 14:fe2e16cdf219
File content as of revision 13:feadff02d3f7:
//#ifndef TANKENGINE_H //#define TANKENGINE_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Projectile.h" #include "Tank.h" #include "Graphics.h" #include "Maps.h" class TanksEngine { public: TanksEngine(); ~TanksEngine(); void initgame(); void left_tank_turn(Graphics &graphics, Gamepad &pad); void right_tank_turn(Graphics &graphics, Gamepad &pad); void projectile_phase(N5110 &lcd); void read_input(Gamepad &pad); void render(Graphics graphics, N5110 &lcd); int get_turn(); void end(); private: void _left_tank_shoots(); void _right_tank_shoots(); bool _collision_pl(Tank _tankl, Projectile _proj); bool _collision_pr(Tank _tankr, Projectile _proj); bool _collision_pm(N5110 &lcd, Projectile _proj); void _object_hit(N5110 &lcd); void _change_turn(); void _decrement_cooldowns(); int cooldownl; int cooldownr; int _turn; int _turn_timer; int _move; bool _fire; float _angle; float _vel; float _grav; float _wind; Tank _tankl; Tank _tankr; Projectile _proj; };