From 914d59f13f558667d432b7e99cc64dd3ce132c65 Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Fri, 15 Mar 2024 13:28:04 +0100 Subject: [PATCH] introduce timer + no bomb on 1er click --- main.c | 56 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/main.c b/main.c index 5931be5..b83f10d 100644 --- a/main.c +++ b/main.c @@ -58,6 +58,9 @@ Rectangle grid = {0}; const Color text_color = BLACK; const Color hover_color = RED; +float timer = 0.0f; +int need_to_fill = 1; + #define INIT_TEXTURE(img, tex) \ Image img = {0}; \ Texture tex = {0} @@ -140,7 +143,7 @@ int count_bomb(int x, int y) return count; } -void fill_game(void) +void setup_game(void) { switch (current_game_type) { case BEGINNER: @@ -167,11 +170,18 @@ void fill_game(void) default: assert(0 && "game mode not supported"); } +} +void fill_game(int click_x, int click_y) +{ + setup_game(); for (int i=0; i