SharpShooter

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player

Revision:
11:55b65415b6ba
Parent:
7:ed2c73e25681
Child:
12:2f358065ba3f
--- a/Bullet.h	Fri Oct 28 19:02:28 2016 +0000
+++ b/Bullet.h	Fri Oct 28 20:07:38 2016 +0000
@@ -1,22 +1,30 @@
+extern uLCD_4DGL uLCD;
+
+struct BulletLocation {
+    int x, topY, bottomY;   
+};
+
 class Bullet {
     
         int x, topY, bottomY;
-        int length = 3;
-        int speed = 3;
-        uLCD_4DGL uLCD;
-        struct Coordinate {
-            int x1, y1, x2, y2;
-        }
+        int length;
+        int speed;
+        
         
     public:   
-        Bullet(uLCD_4DGL uLCD);
+        Bullet();
         void drawBullet(int x, int bottomY);
         void eraseBullet();
-        void move();            
+        void move();   
+        BulletLocation getLocation();         
 };
 
-Bullet::Bullet(uLCD_4DGL uLCD) {
-    this->uLCD = uLCD;
+Bullet::Bullet() {
+    length = 3;
+    speed = 3;
+    x=1;
+    topY=2;
+    bottomY=3;
 }
 
 /*Bullet::Bullet(int x, int bottomY, uLCD_4DGL uLCD) {
@@ -42,7 +50,7 @@
     uLCD.line(x,topY,x,bottomY, 0x000000);
 }
 
-Coordinate Bullet::getLocation() {
-    Coordinate coor = {x, topY, x, bottomY;}
+BulletLocation Bullet::getLocation() {
+    BulletLocation coor {x, topY, bottomY};
     return coor;
 }