ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Revision:
2:c2316b659b97
Child:
3:8a140aa1ddcd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BulletS/BulletS.cpp	Sat Mar 14 20:52:07 2020 +0000
@@ -0,0 +1,33 @@
+#include Bullet.h
+
+Bullet::Bullet()
+{
+}
+
+void Bullet::init(int size, int speed, int x, int y)
+{ 
+    Size = size;
+    Speed = 0;
+    X = WIDTH/2 - Size/2; //Middle of the ship
+    Y = HEIGHT - Height; //Top of the ship
+}
+
+void Bullet::draw(N5110 &lcd)
+{
+    lcd.drawRect(X,Y,Size,Size,FILL_BLACK);
+}
+
+void update();
+    if(pad.A_pressed()) {
+        Speed = 1; //shoots bullet if pad a pressed
+        Y -= Speed;
+    } 
+    
+Vector2D Ship::get_position();
+    Vector2D p = {X,Y};
+    return p;    
+}
+
+
+    
+    
\ No newline at end of file