ELEC2645 (2018/19) / Mbed 2 deprecated el17lw

Dependencies:   mbed

Revision:
27:c920c5ec31af
Parent:
26:4253656c0755
Child:
28:be77ad6c0bda
--- a/Skateboarder/Stakeboarder.cpp	Fri May 03 09:33:34 2019 +0000
+++ b/Skateboarder/Stakeboarder.cpp	Sat May 04 13:26:50 2019 +0000
@@ -171,8 +171,9 @@
     Gamepad &gamepad) {
   _jump_counter = jump_counter;
   _level_condition = level_condition; 
-  // Jump condition. Jump from A button must be true. 
-  if (jump) {  
+  // Jump condition. Jump from A button must be true and counter less than 35 to
+  // limit double jump. 
+  if (jump && _jump_counter < 35) {  
     _jump_counter = 40;  // Controls height and fall time.
     gamepad.tone(440, 0.05);  // Buzzer jump sound.
     wait(0.05);