ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_ll17lrc_v2

Dependencies:   mbed

Revision:
8:10eb578dd754
Parent:
7:35465b3bf586
Child:
9:e2dd152867d1
--- a/Imposs/ImpossEngine.cpp	Mon May 18 14:28:05 2020 +0000
+++ b/Imposs/ImpossEngine.cpp	Mon May 18 15:08:54 2020 +0000
@@ -27,7 +27,7 @@
     _mag = pad.get_mag();
 }
 
-void ImpossEngine::draw(N5110 &lcd)
+void ImpossEngine::draw(N5110 &lcd,Gamepad &pad)
 {
     // draw the elements in the LCD buffer
     // pitch   
@@ -41,7 +41,11 @@
         _one.draw(lcd);
     } 
     
-     _ball.update(_d);
+    if (level == 2){
+        _two.draw(lcd);
+    }
+    
+     _ball.update(_d,pad);
     
     _ball.draw(lcd);
 
@@ -73,7 +77,7 @@
     bool collision = false;
     //check around ball to see if it has made contact with anything
     
-    while(i < 4){
+    while(i < 3){
         
         i++;
         
@@ -87,7 +91,7 @@
     
     i = 0;
      
-    while(i < 4){
+    while(i < 3){
         
         i++;
         
@@ -101,7 +105,7 @@
     
     i = 0;
     
-    while(i < 4){
+    while(i < 3){
         
         i++;
         
@@ -115,7 +119,7 @@
     
     i = 0;
     
-    while(i < 4){
+    while(i < 3){
         
         i++;