главная|main page

состояние|status

блог|blog

файлы|files

программы|software

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Davydov <lotigara@lotigara.ru>2025-04-26 11:21:05 +0300
committerIvan Davydov <lotigara@lotigara.ru>2025-04-26 11:21:05 +0300
commitb3e49626f46013317acff88268c5409029a6d4b7 (patch)
tree619dfb6acb254cbd836d1394e69d74396fd0ea18
parent8995746812ee29de72d5f79d6b1b0717dee7155b (diff)
Remove a delay that did not work and initialize the score variableHEADmaster
-rw-r--r--clicker-ncurses.c8
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);