mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
widecolor-demo: move snake more quickly #110
This commit is contained in:
parent
6c5bd5d263
commit
541f9304df
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: dankamongmen
|
||||
github: dankamongmen
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user