ELEC2645 (2017/18) / Mbed 2 deprecated el17yw

Dependencies:   mbed

Revision:
3:1a134243e2f0
Child:
4:55d904040636
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boom/boom.cpp	Sun Apr 15 17:36:29 2018 +0000
@@ -0,0 +1,52 @@
+#include "boom.h"
+
+boom::boom()
+{
+
+}
+
+boom::~boom()
+{
+
+}
+
+
+void boom::init(int x,int y)
+{
+    boom_x = x;
+    boom_y = y;
+    //boom_speed = 5;  // default speed
+   
+
+}
+
+void boom::draw(N5110 &lcd)
+{
+     lcd.drawCircle(boom_x+3,boom_y+3,3,FILL_TRANSPARENT);
+    
+    
+}
+
+void boom::update(Direction d,float mag)
+{
+    boom_speed = rand()%10;
+    boom_y+= boom_speed; 
+
+
+    // check the y origin to ensure that the paddle doesn't go off screen
+    if (boom_y < 1) {
+        boom_y = 0;
+    }
+    if (boom_y > 48) {
+        boom_y = 45;
+    }
+
+    if (boom_x < 1) {
+        boom_x = 0;
+    }
+    if (boom_x > 84) {
+        boom_x = 81;
+    }
+}
+
+