Soft'N'Design Software
/
projects
/
snake.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39eebea
)
increase speed
author
Laurent Mazet
<mazet@softndesign.org>
Thu, 29 Aug 2024 08:03:12 +0000
(10:03 +0200)
committer
Laurent Mazet
<mazet@softndesign.org>
Thu, 29 Aug 2024 08:03:12 +0000
(10:03 +0200)
snake.c
patch
|
blob
|
blame
|
history
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);