ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Revision:
6:5bea67cc96f9
Parent:
5:e5bb95fb308b
Child:
7:06a2558155f0
--- a/BulletS/BulletS.cpp	Sun Mar 22 19:06:39 2020 +0000
+++ b/BulletS/BulletS.cpp	Mon Mar 23 15:20:59 2020 +0000
@@ -4,11 +4,11 @@
 {
 }
 
-void Bullet::init(int size, int speed, int Height)  {
+void Bullet::init(int size, int x, int y)  {
     Size = size;
-    Speed = speed;
-    X = WIDTH/2 - Size/2; //Middle of the ship
-    Y = HEIGHT - Height; //Top of the ship Height is ship Height
+    Speed = 0;
+    X = x;                                      //x=Middle of the ship
+    Y = HEIGHT;                                      //y=Top of the ship Height is ship Height
 }
 
 void Bullet::draw(N5110 &lcd)
@@ -18,7 +18,7 @@
 
 void Bullet::update() {
     if(pad.A_pressed()) {
-        Speed = 1; //shoots bullet if pad a pressed
+        Speed = 1;                            //shoots bullet if pad a pressed
         Y -= Speed;
     } 
 }