Mochu Yao explorer game
Dependencies: mbed
Diff: explorer/explorer.cpp
- Revision:
- 17:1b4ecc01b79f
- Parent:
- 8:201ef0618b7d
- Child:
- 19:14c5427b30d1
--- a/explorer/explorer.cpp Tue Apr 28 12:21:31 2020 +0000 +++ b/explorer/explorer.cpp Tue Apr 28 12:50:40 2020 +0000 @@ -68,12 +68,12 @@ //this process is to set x and make sure the player can move _player_direction = direction; _speed = speed; - if (joy_x < float(-0.5)) { + if (joy_x < float(-0.1)) { _speed = _speed--;// _player_direction = left; _explorer_sprite = Move_left;//makesure the value is the Move_left value in the enum //now x is moving to the right than add to the X position - } else if (joy_x > float(0.5)) { + } else if (joy_x > float(0.1)) { _speed = _speed++; _player_direction = right; _explorer_sprite = Move_right;//makesure the value is the Move_right value in the enum @@ -82,7 +82,7 @@ } else { _explorer_sprite = Stand_left;//the least situation is equals to enum Stand_right. } - _x = 0.5*_speed + 30;//this equation decides how fast the player move later I will update differnet modes to choose different speed + _x = 0.2*_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){