Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Skateboarder/Stakeboarder.cpp
- Revision:
- 8:5327418f823a
- Parent:
- 7:bbc2b75c1418
- Child:
- 9:fff2009f826e
--- a/Skateboarder/Stakeboarder.cpp Wed Mar 20 17:56:55 2019 +0000 +++ b/Skateboarder/Stakeboarder.cpp Sat Mar 23 15:36:56 2019 +0000 @@ -228,4 +228,31 @@ } else { return *skate_stand_right; } -} \ No newline at end of file +} + +void Skateboarder::fall(bool fall_flag) { + _fall_flag = fall_flag; + _y++; + if(_y == 80) { + _fall_flag = false; + _reset_flag = true; + } + } + +bool Skateboarder::get_fall_flag() { + return _fall_flag; + } + +bool Skateboarder::get_reset_flag() { + return _reset_flag; + } + +void Skateboarder::set_reset_flag(bool flag) { + if(flag) { + _reset_flag = true; + } else { + _reset_flag = false; + } + } + + \ No newline at end of file