ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Revision:
4:18a1fc4c38e0
Parent:
3:8a140aa1ddcd
Child:
5:e5bb95fb308b
--- a/BulletS/BulletS.cpp	Sat Mar 14 21:19:58 2020 +0000
+++ b/BulletS/BulletS.cpp	Sun Mar 22 18:51:00 2020 +0000
@@ -5,12 +5,11 @@
 {
 }
 
-void Bullet::init(int size, int speed)
-{   int ShipHeight = get_height();
+void Bullet::init(int size, int speed)  {
     Size = size;
     Speed = speed;
     X = WIDTH/2 - Size/2; //Middle of the ship
-    Y = HEIGHT - ShipHeight; //Top of the ship
+    Y = HEIGHT - Height; //Top of the ship
 }
 
 void Bullet::draw(N5110 &lcd)
@@ -18,17 +17,22 @@
     lcd.drawRect(X,Y,Size,Size,FILL_BLACK);
 }
 
-void update();
+void Bullet::update() {
     if(pad.A_pressed()) {
         Speed = 1; //shoots bullet if pad a pressed
         Y -= Speed;
     } 
+}
     
-Vector2D Ship::get_position();
+Vector2D Bullet::get_position() {
     Vector2D p = {X,Y};
     return p;    
 }
 
+//void Bullet::set_hit(bool hit) {
+//    bool Hit == hit;
+//}
+
 
     
     
\ No newline at end of file