Mochu Yao explorer game

Dependencies:   mbed

Revision:
34:66e37a0d59c3
Parent:
33:ea83f08fa466
Child:
36:cdfba51a0a44
--- a/explorer/explorer.cpp	Wed Apr 29 13:28:41 2020 +0000
+++ b/explorer/explorer.cpp	Wed Apr 29 13:43:20 2020 +0000
@@ -82,7 +82,7 @@
   } else { 
     _explorer_sprite = Stand_left;//the least situation is equals to enum Stand_right.
   }      
-  _x = _speed + 30;//this equation decides how fast the player move later I will update differnet modes to choose different speed
+  _x = 0.5*_speed + 30;//this equation decides how fast the player move later I will update differnet modes to choose different speed
 }
 //this function is easy to understand because this is just choosing different sprite according to the direction
 int * Explorer::get_form(Explorer_sprite sprite){
@@ -105,10 +105,10 @@
   return _explorer_sprite;
 }
     
-void Explorer::set_y_coordinate(bool ifjump, int jump_height, int ) {
+void Explorer::set_y_coordinate(bool ifjump, int jump_height, int y_flag) {
   _jump_height = jump_height;
-  if (ifjump && _jump_height < 35) {  
-    _jump_height = 40; }
+  if (ifjump && _jump_height < 40) {  
+    _jump_height = 30; }
   if (_jump_height !=0) _speed--;  // Keep falling until not jumping.
   if ((_line_4.left <= _x - 5) && (_line_4.right >= _x)){
     _y_flag = 1;}
@@ -121,8 +121,7 @@
     else if ((_line_2.left <= _x) && (_line_2.right >= _x)){
     _y_flag = 0;}
     else if ((_line_3.left <= _x) && (_line_3.right >= _x)){
-    _y_flag = 0;}
-  }       
+    _y_flag = 0;}    
   if (_y_flag == 1 && ifjump) { 
     _platform = 5;
   } else if (_y_flag == 0) {