ECE 4180 Final

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

Revision:
20:7d56cdcbc9a5
Parent:
19:d65f9fb1023b
Child:
21:cbcbb3480cad
diff -r d65f9fb1023b -r 7d56cdcbc9a5 Lane.cpp
--- a/Lane.cpp	Fri Dec 06 15:46:16 2019 +0000
+++ b/Lane.cpp	Fri Dec 06 18:00:11 2019 +0000
@@ -13,8 +13,10 @@
 }
 
 void Lane::draw() {
-    for (pops_ptr = pops.begin(); pops_ptr < pops.end(); pops_ptr++) {
-        (*pops_ptr).draw();
+    if (!pops.empty()){
+        for (pops_ptr = pops.begin(); pops_ptr < pops.end(); pops_ptr++) {
+            (*pops_ptr).draw();
+        }
     }
 }
 
@@ -25,6 +27,7 @@
         // black out the bubble and remove it from the lane's vector
         (pops.begin())->clear();
         pops.erase(pops.begin());
+        ++bubblesMissed;
     }
     
     for (pops_ptr = pops.begin(); pops_ptr < pops.end(); pops_ptr++) {