Target Library

Dependents:   GameProject_Prototype

Revision:
12:855610bdba49
Parent:
11:5b2be6934e1b
Child:
13:828ede9cf8a5
--- a/Target.cpp	Tue May 02 16:25:54 2017 +0000
+++ b/Target.cpp	Wed May 03 13:33:40 2017 +0000
@@ -10,17 +10,18 @@
 
 }
 
-int sprite2[5][5] = {
-    {1,0,1,0,1},
-    {0,1,0,1,0},
-    {1,0,1,0,1},
-    {0,1,0,1,0},
-    {1,0,1,0,1},
+int sprite2[8][10] = {
+    {1,1,1,1,1,1,1,1,1,1},
+    {1,1,0,1,0,1,0,1,0,1},
+    {1,0,1,0,1,0,1,0,1,1},
+    {1,1,0,1,0,1,0,1,0,1},
+    {1,0,1,0,1,0,1,0,1,1},
+    {1,1,0,1,0,1,0,1,0,1},
+    {1,0,1,0,1,0,1,0,1,1},
+    {1,1,1,1,1,1,1,1,1,1},
     };
     
 int n = 0;
-int b = 0;
-int v = 0;
 void Target::init() //Delete Int
 {
 
@@ -31,19 +32,31 @@
 void Target::draw(N5110 &lcd)
 {   
 
-    _velocity.x = 0;
+    //_velocity.x = 1;
     _velocity.y = 1;
     
+   /* int random = rand() % 3;
+    if(random == 0){
+        _velocity.x = 0;
+        }
+    if(random == 1){
+        _velocity.x = 2;
+        }
+    if(random == 2){
+        _velocity.x = -2;
+        }
+    if(random == 3){
+        _velocity.x = -2;
+        }
+    */
+    
     if(_x <= -1){
-        n = 0;
-        }
-    if(_x >= 85){
-        n = 0;
+        _x = 0;
         }
-    if(_y <= -1){
-        n = 0;
+    if(_x >= 75){
+        _x = 74;
         }
-    if(_y >= 49){
+    if(_y >= 48){
         n = 0;
         }
     
@@ -53,7 +66,7 @@
         n = n+1;  
         }
 
-    lcd.drawSprite(_x,_y,5,5,(int *)sprite2);
+    lcd.drawSprite(_x,_y,8,10,(int *)sprite2);
 }