lavat

Un fork de lavat pour pouvoir y ajouter des titres - retour accueil

git clone git://bebou.netlib.re/lavat
Log | Files | Refs | README | LICENSE |

commit be6adee51baf1db0dac108d5ba0f0eced18b2bb6
parent f1cfe6bab6f4e3762b1a0e29122f318741984deb
Auteurice: AngelJumbo <anarjumb@gmail.com>
Date:   Sun, 27 Nov 2022 00:28:40 -0500

Change the speed while the program runs with the - and + keys

Diffstat:
Mlavat.c | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/lavat.c b/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."