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: Tank/Tank.cpp
- Revision:
- 15:fa5282fcd134
- Parent:
- 13:feadff02d3f7
- Child:
- 16:a2c945279b79
diff -r fe2e16cdf219 -r fa5282fcd134 Tank/Tank.cpp
--- a/Tank/Tank.cpp Wed Apr 17 17:24:02 2019 +0000
+++ b/Tank/Tank.cpp Fri Apr 19 15:58:51 2019 +0000
@@ -7,14 +7,14 @@
Tank::Tank()
{
-
+ _speed = 1;
}
Tank::~Tank()
{
}
-
+// Accessors
int Tank::get_position_x()
{
return _position_x;
@@ -34,7 +34,7 @@
{
return _health;
}
-
+// Mutators
void Tank::set_position(int x, int y)
{
_position_x = x;
@@ -56,12 +56,7 @@
{
_speed = s;
}
-
-void Tank::set_angle(float angle)
-{
- _angle = angle;
-}
-
+// Movement
void Tank::_limit_movement()
{
if (_position_x == _left_lim - 1) {
@@ -85,12 +80,10 @@
}
_limit_movement();
}
-
+// Other Methods
void Tank::lose_health()
{
_health--;
-/* if (_health <= 0) right player wins
-{} */
}
void Tank::generate_hitbox()