increase speed
authorLaurent Mazet <mazet@softndesign.org>
Thu, 29 Aug 2024 08:03:12 +0000 (10:03 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Thu, 29 Aug 2024 08:03:12 +0000 (10:03 +0200)
snake.c

diff --git a/snake.c b/snake.c
index 8a15985a5d33a0fe01ac2332fe63fcee55e0d2d2..bdcb61ccc036a1672ef9a8d059109a832382c375 100644 (file)
--- a/snake.c
+++ b/snake.c
@@ -19,8 +19,10 @@ char *progname = NULL;
 char *version = "0.1";
 
 char *filename = NULL;
+int ratio = 10;
 int scale = 1;
 int seed = 0;
+int speed = 500;
 int malus = 10;
 int bonus = 5;
 
@@ -149,7 +151,6 @@ int main (int argc, char *argv[])
     int mode = 0;
     timeval_t turn = {0, 0};
     timeval_t renew = {0, 0};
-    int speed = 1000;
     while (!stop) {
 
         boardwindow (board, 0);
@@ -162,7 +163,7 @@ int main (int argc, char *argv[])
             }
             if (isovertime (&renew)) {
                 drawbonus (board, malus, bonus);
-                setendtime (&renew, 10 * speed);
+                setendtime (&renew, ratio * speed);
             }
         }
         displaysnake (board, snake);