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: Map/Map.cpp
- Revision:
- 30:c36a08e8f5de
- Parent:
- 29:42651f87522b
- Child:
- 31:c95f1b1d6423
diff -r 42651f87522b -r c36a08e8f5de Map/Map.cpp
--- a/Map/Map.cpp Sat Apr 27 12:50:30 2019 +0000
+++ b/Map/Map.cpp Sat Apr 27 13:07:25 2019 +0000
@@ -49,7 +49,10 @@
bool Map::check_wall_collision(Gamepad &gamepad, Ball &ball){
bool collision = false;
- Vector2D c = ball.get_position();
+ Vector2D ball_screen_pos = ball.get_position();
+ Vector2D c;
+ c.x = ball_screen_pos.x + _coord.x;
+ c.y = ball_screen_pos.y + _coord.y;
Vector2D ball_pixels[37] = {
{c.x,c.y},{c.x+1,c.y},{c.x+2,c.y},{c.x+3,c.y},{c.x-1,c.y},{c.x-2,c.y},
{c.x-3,c.y},{c.x,c.y+1},{c.x+1,c.y+1},{c.x+2,c.y+1},{c.x+3,c.y+1},