Mochu Yao explorer game
Dependencies: mbed
Diff: explorer/explorer.h
- Revision:
- 33:ea83f08fa466
- Parent:
- 30:65e639ace415
- Child:
- 36:cdfba51a0a44
--- a/explorer/explorer.h Wed Apr 29 12:19:12 2020 +0000 +++ b/explorer/explorer.h Wed Apr 29 13:28:41 2020 +0000 @@ -34,10 +34,10 @@ int _player_x; int _player_y; bool _f_flag; -bool _r_flag; bool _start_flag; int _speed; int _jump_height; +int _y_flag; Player_direction _player_direction; Explorer_sprite _explorer_sprite; @@ -51,7 +51,7 @@ { _player.fall(_f_flag, gamepad); } else { - _player.set_y_coordinate(false, _jump_height); } + _player.set_y_coordinate(false, _jump_height, _y_flag} _f_flag = _player.get_fall_flag(); _player_y = _player.get_y(); _jump_height = _player.get_jump_height(); @@ -64,8 +64,6 @@ //change in to a new direction. _player_direction = _player.get_direction(); - - _r_flag = _player.get_reset_flag(); lcd.drawSprite(_player_x,_player_y,10,10,(int *)_player.get_form(_explorer_sprite));//draw the player } @@ -99,8 +97,10 @@ * @brief Sets the Y coordinate of the Explorer. * @param ifjump @details B boolean flag that is true only if the B button is pressed * @param jump_height @details the height when player jumps and which level to stay + * @param y_flag @details the upper or lower surface + * @param platform @details the y for the platform */ -void set_y_coordinate(bool ifjump, int jump_height); +void set_y_coordinate(bool ifjump, int jump_height, int y_flag); /** * @brief get y coordinate. * @returns The y coordinate of the explorer @@ -166,6 +166,8 @@ int _jump_height; bool _f_flag; bool _r_flag; +int _platform; +int _y_flag; Line _line_1; Line _line_2; Line _line_3;