Faster and slower
This commit is contained in:
@@ -858,7 +858,7 @@ int main(int argc, char **argv)
|
|||||||
next = newwin(6, 10, 0, 2 * (tg->cols + 1) + 1);
|
next = newwin(6, 10, 0, 2 * (tg->cols + 1) + 1);
|
||||||
hold = newwin(6, 10, 7, 2 * (tg->cols + 1) + 1);
|
hold = newwin(6, 10, 7, 2 * (tg->cols + 1) + 1);
|
||||||
score = newwin(6, 10, 14, 2 * (tg->cols + 1 ) + 1);
|
score = newwin(6, 10, 14, 2 * (tg->cols + 1 ) + 1);
|
||||||
|
int32_t counter = 0;
|
||||||
// Game loop
|
// Game loop
|
||||||
while (running) {
|
while (running) {
|
||||||
running = tg_tick(tg, move);
|
running = tg_tick(tg, move);
|
||||||
@@ -866,8 +866,9 @@ int main(int argc, char **argv)
|
|||||||
display_piece(next, tg->next);
|
display_piece(next, tg->next);
|
||||||
display_piece(hold, tg->stored);
|
display_piece(hold, tg->stored);
|
||||||
display_score(score, tg);
|
display_score(score, tg);
|
||||||
doupdate();
|
if ( (counter++ & 1) == 0 )
|
||||||
sleep_milli(50);
|
doupdate();
|
||||||
|
sleep_milli(25);
|
||||||
|
|
||||||
switch (getch()) {
|
switch (getch()) {
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
|
|||||||
Reference in New Issue
Block a user