widecolor-demo: move snake more quickly #110

This commit is contained in:
nick black 2019-12-05 08:52:25 -05:00
parent 6c5bd5d263
commit 541f9304df
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 7 additions and 1 deletions

4
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,4 @@
# These are supported funding model platforms
patreon: dankamongmen
github: dankamongmen

View File

@ -23,6 +23,8 @@ snake_thread(void* vnc){
cell_prime(n, &head, "🐍", 0, channels);
cell c = CELL_TRIVIAL_INITIALIZER;
cell_bg_default(&head);
struct timespec iterdelay;
timespec_div(&demodelay, 10, &iterdelay);
while(true){
pthread_testcancel();
ncplane_cursor_move_yx(n, y, x);
@ -33,7 +35,7 @@ snake_thread(void* vnc){
ncplane_cursor_move_yx(n, y, x);
ncplane_putc(n, &c);
int oldy, oldx;
clock_nanosleep(CLOCK_MONOTONIC, 0, &demodelay, NULL);
clock_nanosleep(CLOCK_MONOTONIC, 0, &iterdelay, NULL);
do{ // force a move
oldy = y;
oldx = x;