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
Diff: TanksEngine/TanksEngine.h
- Revision:
- 12:9e6d5d0a0c82
- Parent:
- 11:4e2eb64031a0
- Child:
- 13:feadff02d3f7
--- a/TanksEngine/TanksEngine.h Sat Apr 13 16:31:43 2019 +0000 +++ b/TanksEngine/TanksEngine.h Sun Apr 14 15:58:12 2019 +0000 @@ -5,7 +5,8 @@ #include "N5110.h" #include "Gamepad.h" #include "Projectile.h" -#include "TankL.h" +#include "Tank.h" +#include "Graphics.h" class TanksEngine { @@ -15,28 +16,34 @@ ~TanksEngine(); void initgame(); - void left_tank_turn(Gamepad &pad, N5110 &lcd); - void projectile_phase(N5110 &lcd); - void right_tank_turn(Gamepad &pad, N5110 &lcd); + void left_tank_turn(Gamepad &pad); + void right_tank_turn(Gamepad &pad); + void projectile_phase(); + void read_input(Gamepad &pad); + void render(Graphics graphics, N5110 &lcd); int get_turn(); + void end(); private: - - void _read_input(Gamepad &pad); + void _left_tank_shoots(); - bool _collision_pl(TankL _tankl, Projectile _proj); + void _right_tank_shoots(); + bool _collision_pl(Tank _tankl, Projectile _proj); void _change_turn(); + void _decrement_cooldowns(); + int cooldownl; + int cooldownr; int _turn; int _turn_timer; - int _turn_alternater; int _move; bool _fire; float _power; float _angle; float _mag; - TankL _tankl; + Tank _tankl; + Tank _tankr; Projectile _proj; };