mirror of
https://github.com/AngelJumbo/lavat.git
synced 2024-12-22 05:56:37 +00:00
Change the speed while the program runs with the - and + keys
This commit is contained in:
parent
f1cfe6bab6
commit
be6adee51b
18
lavat.c
18
lavat.c
@ -145,6 +145,22 @@ int main(int argc, char *argv[]) {
|
||||
tb_clear();
|
||||
|
||||
tb_peek_event(&event, 10);
|
||||
switch (event.ch) {
|
||||
case '-':
|
||||
case '_':
|
||||
if (speedMult < 10) {
|
||||
speedMult++;
|
||||
speed = (((1 / (float)(maxX + maxY)) * 1000000) + 10000) * speedMult;
|
||||
}
|
||||
break;
|
||||
case '+':
|
||||
case '=':
|
||||
if (speedMult > 1) {
|
||||
speedMult--;
|
||||
speed = (((1 / (float)(maxX + maxY)) * 1000000) + 10000) * speedMult;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (event.key == TB_KEY_CTRL_C || event.key == TB_KEY_ESC ||
|
||||
event.ch == 'q' || event.ch == 'Q')
|
||||
break;
|
||||
@ -252,6 +268,8 @@ void print_help() {
|
||||
" Besides those colors the default one is the normal"
|
||||
" foreground of your terminal.\n"
|
||||
" -s <SPEED> Set the speed, from 1 to 10. (default 5)\n"
|
||||
" Change the speed while the program runs "
|
||||
"with the - and + keys.\n"
|
||||
" -r <RADIUS> Set the radius of the metaballs, from 1 to 10. "
|
||||
"(default: 5)\n"
|
||||
" -R <RIM> Set a rim for each metaball, sizes from 1 to 5."
|
||||
|
Loading…
Reference in New Issue
Block a user