]> git.gir.st - VIper.git/commit
fix: snake speed bug
authorgirst <girst@users.noreply.github.com>
Fri, 31 Aug 2018 20:57:33 +0000 (22:57 +0200)
committergirst <girst@users.noreply.github.com>
Fri, 31 Aug 2018 20:57:33 +0000 (22:57 +0200)
commitd388ebe26008c86badcbbf280af0057aa04aaf2c
tree65e0755de1070fa0bb9317b251959075c8ac1d3a
parenta60a800a028e21976791d9d9c8a5619664c37f87
fix: snake speed bug

originally, I noticed the snake speeding up when eating a BONUS_SLOW,
suspecting a bug there. as i found out a after way too long, i forgot to
restart the timer after routinely incrementing the velocity every 100
points. m(

however, a nice routine for debugging this was the following at the end
of the draw_sprites():
 #include<sys/timeb.h>
 struct timeb __now_time__;
 ftime(&__now_time__);
 long __time__ = __now_time__.time*1000+__now_time__.millitm;
 static long __last_time__ = 0;
 if(__last_time__) printf ("->%f (%ld)<-", g.v, __time__-__last_time__);
 __last_time__ = __time__;
viiper.c
Imprint / Impressum