diff options
-rw-r--r-- | clicker-ncurses.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clicker-ncurses.c b/clicker-ncurses.c index 6c30449..f68f3fb 100644 --- a/clicker-ncurses.c +++ b/clicker-ncurses.c @@ -1,4 +1,3 @@ -#include <stdarg.h> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -22,10 +21,6 @@ main (void) /* This fixes the problem of input that shows up */ noecho(); - /* There should be a delay between clicks - 1 s */ - timeout(1000); - /* Place a border with default settings (0 means default) */ border(0, 0, 0, 0, 0, 0, 0, 0); @@ -51,6 +46,7 @@ main (void) struct game *cur_game = malloc(sizeof(struct game)); cur_game->click = 1; cur_game->multiplifier = 128; + cur_game->score = 0; /* The main loop that also catches user input */ int ch = 0; @@ -58,6 +54,7 @@ main (void) { switch (ch) { + /* TODO: Make a delay between clicks, it is possible either via X, or custom Linux APIs that cannot be used in cross-platform software */ case ' ': render_values(cur_game, cur_game->score + cur_game->click, cur_game->click, cur_game->multiplifier); break; @@ -99,6 +96,7 @@ render_values (struct game *game, int score, int click, int multiplifier) game->score = score; game->click = click; game->multiplifier = multiplifier; + mvprintw(4, 1, "%d", game->score); mvprintw(6, 1, "%d", game->click); mvprintw(8, 1, "%d", game->multiplifier * game->click); |