ELEC2645 (2017/18) / Mbed 2 deprecated el17yw

Dependencies:   mbed

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;
 }
 
 
-
-
-