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-24
- Revision:
- 16:a2c945279b79
- Parent:
- 15:fa5282fcd134
- Child:
- 17:cb39d9fa08dc
File content as of revision 16:a2c945279b79:
#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 "Menus.h" #include "Scores.h" class TanksEngine { public: TanksEngine(); ~TanksEngine(); void initgame(Menus &menus); void game_loop(Graphics &graphics, N5110 &lcd, Gamepad &pad, Menus &menus, Scores &scores); private: // Game Flow void _left_tank_turn(Graphics &graphics, Gamepad &pad); void _right_tank_turn(Graphics &graphics, Gamepad &pad); void _projectile_phase(N5110 &lcd, Gamepad &pad); void _change_turn(); void _end(Graphics &graphics, N5110 &lcd, Gamepad &pad, Scores &scores); // Game Mechanics void _tank_shoots(int x, int y, int turn, Gamepad &pad); void _object_hit(int x, int y, N5110 &lcd, Gamepad &pad); bool _collision_pl(Tank _tankl, Projectile _proj); bool _collision_pr(Tank _tankr, Projectile _proj); bool _collision_pm(int x, int y, N5110 &lcd, Projectile _proj); // Game Inputs void _read_input(Gamepad &pad); void _decrement_cooldowns(); // Game Outputs void _draw(Graphics graphics, N5110 &lcd); void _sounds(int n, Gamepad &pad); Tank _tankl; Tank _tankr; Projectile _proj; int _initial_health; int _cooldown_l; int _cooldown_r; int _move; int _turn; int _turn_counter; bool _fire; bool _mute; float _angle; float _mag; float _vel; float _grav; float _wind; }; #endif // TANKSENGINE_H