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: boom/boom.cpp
- Revision:
- 5:0a116644cce2
- Parent:
- 4:55d904040636
- Child:
- 6:46d0caedf217
--- a/boom/boom.cpp Mon Apr 16 00:11:15 2018 +0000
+++ b/boom/boom.cpp Mon Apr 16 09:57:57 2018 +0000
@@ -28,21 +28,21 @@
void boom::update()
{
- boom_speed = rand()%10;
- boom_x = rand()%84;
+ boom_speed = rand()%5;
boom_y+= boom_speed;
// check the y origin to ensure that the paddle doesn't go off screen
- if (boom_y > 48) {
- boom_y = 0;
- }
-
- if (boom_x == 84) {
- boom_x = 81;
- }
+
+}
+Vector2D boom::get_pos()
+{
+ Vector2D p = {boom_x,boom_y};
+ return p;
+}
+void boom::set_pos(Vector2D p)
+{
+ boom_x = p.x;
+ boom_y = p.y;
}
-
-
-