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.
Diff: BreakoutEngine/BreakoutEngine.cpp
- Revision:
- 81:735e5ee2c92a
- Parent:
- 80:f57acdb7121f
- Child:
- 82:d1341d632890
--- a/BreakoutEngine/BreakoutEngine.cpp Mon May 06 14:18:35 2019 +0000
+++ b/BreakoutEngine/BreakoutEngine.cpp Mon May 06 14:23:19 2019 +0000
@@ -87,7 +87,7 @@
//printf("init ended /n");
}
-void BreakoutEngine::reset() // rename to reset add in ball reset and use to increase the number of balls each time
+void BreakoutEngine::reset_game() // rename to reset add in ball reset and use to increase the number of balls each time
{
reset_num_left();
_ball.init(_ball_size,_speed + _multiplier/2, _p1.get_pos().x + 7); // replace the 1 with a multiplier private variable that tracks the number of times continued from victory
@@ -192,7 +192,7 @@
void BreakoutEngine::update(Gamepad &pad)
{
- check_goal(pad);
+ check_loss(pad);
// important to update paddles and ball before checking collisions so can
// correct for it before updating the display
_p1.update(_d,_mag);
@@ -414,7 +414,7 @@
}
}
-bool BreakoutEngine::check_goal(Gamepad &pad)
+bool BreakoutEngine::check_loss(Gamepad &pad)
{
Vector2D ball_pos = _ball.get_pos();
// P1 has scored