ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Revision:
29:bdc4138b5171
Parent:
28:be77ad6c0bda
diff -r be77ad6c0bda -r bdc4138b5171 Skateboarder/Stakeboarder.cpp
--- a/Skateboarder/Stakeboarder.cpp	Tue May 07 08:39:38 2019 +0000
+++ b/Skateboarder/Stakeboarder.cpp	Tue May 07 17:21:00 2019 +0000
@@ -130,12 +130,13 @@
     float joy_x, 
     int moving_counter, 
     Skate_direction direction, 
-    float joy_y) {     
+    float joy_y) {
+  // Set up the new x coord and use that to set the sprite.           
   _skate_direction = direction;
   _moving_counter = moving_counter;
   process_x_variables(joy_x);      
   _x = 40 + 0.4*_moving_counter;  // Moving counter is scaled for speed control.
-  check_duck(joy_y); 
+  check_duck(joy_y);  // Needed to overwrite sprite if ducking.
 }
     
 void Skateboarder::process_x_variables(float joy_x) {