ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el19tb

Dependencies:   mbed

Revision:
9:d210eede4a1b
Parent:
8:52794de935b2
diff -r 52794de935b2 -r d210eede4a1b Frog/Car.cpp
--- a/Frog/Car.cpp	Tue May 12 05:14:17 2020 +0000
+++ b/Frog/Car.cpp	Tue May 12 22:04:05 2020 +0000
@@ -12,10 +12,7 @@
     
     screenHeight = 48;
     screenWidth = 84;
-    size = 3; 
-    
-    // width of all vehicles
-    vehicle.width = grid * size;
+    size = 3;   
 }
 
 void Car::setRow(int row){
@@ -34,6 +31,9 @@
     // intialize the vehicle size and position in lcd
     // x position of all vehicles
     vehicle.x = seperation;
+    
+    // width of all vehicles
+    vehicle.width = grid * size;
 }
 
 void Car::speedSlow(){