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: shot/shot.cpp
- Revision:
- 11:494cc44777fe
- Parent:
- 10:02ab3324be6c
- Child:
- 13:eb60628db8bf
--- a/shot/shot.cpp Sun May 10 05:16:51 2020 +0000 +++ b/shot/shot.cpp Mon May 11 09:09:31 2020 +0000 @@ -124,21 +124,25 @@ } } -void shot::set_size(int size) { +void shot::set_size(int size) +{ _size = size; } -int shot::get_size() { +int shot::get_size() +{ return _size; } -void shot::gen_shot(int timer_flag){ - if(get_size() < 30){ - if(timer_flag == 1){ - timer_flag = 0; - int size = get_size()+ 4; - set_size(size); - } +void shot::gen_shot(int timer_flag, float increment, int max) +{ + if(get_size() < max){ + if(timer_flag == 1){ + timer_flag = 0; + int size = get_size()+ (int)increment; + //printf("Generate\n"); + set_size(size); + } } } \ No newline at end of file