mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -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_prime(n, &head, "🐍", 0, channels);
|
||||||
cell c = CELL_TRIVIAL_INITIALIZER;
|
cell c = CELL_TRIVIAL_INITIALIZER;
|
||||||
cell_bg_default(&head);
|
cell_bg_default(&head);
|
||||||
|
struct timespec iterdelay;
|
||||||
|
timespec_div(&demodelay, 10, &iterdelay);
|
||||||
while(true){
|
while(true){
|
||||||
pthread_testcancel();
|
pthread_testcancel();
|
||||||
ncplane_cursor_move_yx(n, y, x);
|
ncplane_cursor_move_yx(n, y, x);
|
||||||
@ -33,7 +35,7 @@ snake_thread(void* vnc){
|
|||||||
ncplane_cursor_move_yx(n, y, x);
|
ncplane_cursor_move_yx(n, y, x);
|
||||||
ncplane_putc(n, &c);
|
ncplane_putc(n, &c);
|
||||||
int oldy, oldx;
|
int oldy, oldx;
|
||||||
clock_nanosleep(CLOCK_MONOTONIC, 0, &demodelay, NULL);
|
clock_nanosleep(CLOCK_MONOTONIC, 0, &iterdelay, NULL);
|
||||||
do{ // force a move
|
do{ // force a move
|
||||||
oldy = y;
|
oldy = y;
|
||||||
oldx = x;
|
oldx = x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user