Mochu Yao explorer game
Dependencies: mbed
Diff: explorer/explorer.cpp
- Revision:
- 31:8e92b65e0779
- Parent:
- 20:20e6ba54e15c
- Child:
- 33:ea83f08fa466
--- a/explorer/explorer.cpp Wed Apr 29 03:18:13 2020 +0000 +++ b/explorer/explorer.cpp Wed Apr 29 04:49:10 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.1)) { + if (joy_x < float(-0.05)) { _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.1)) { + } else if (joy_x > float(0.05)) { _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.2*_speed + 30;//this equation decides how fast the player move later I will update differnet modes to choose different speed + _x = _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){