From 07bd84873ca19298d357b187f34692ec03483320 Mon Sep 17 00:00:00 2001 From: squee72564 Date: Tue, 2 Jan 2024 00:54:25 -0800 Subject: [PATCH] Added difficulty param to alloc and reset function This way the main allocation function for the app and any scenes that need to (like the settings confirmation scene) can reset the game with the appropraite board dimensions and difficulty --- views/minesweeper_game_screen.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/views/minesweeper_game_screen.h b/views/minesweeper_game_screen.h index bbd4c31..8b40d64 100644 --- a/views/minesweeper_game_screen.h +++ b/views/minesweeper_game_screen.h @@ -13,11 +13,10 @@ // These defines represent how many tiles // can be visually representen on the screen +// due to icon sizes #define MINESWEEPER_SCREEN_TILE_HEIGHT 7 #define MINESWEEPER_SCREEN_TILE_WIDTH 16 -#define MINESWEEPER_STARTING_MINES (44) - #ifdef __cplusplus extern "C" { #endif @@ -36,7 +35,7 @@ typedef bool (*GameScreenInputCallback)(InputEvent* event, void* context); * * @return MineSweeperGameScreen view instance */ -MineSweeperGameScreen* mine_sweeper_game_screen_alloc(uint8_t width, uint8_t height); +MineSweeperGameScreen* mine_sweeper_game_screen_alloc(uint8_t width, uint8_t height, uint8_t difficulty); /** Deinitialize and free Start Screen view * @@ -48,7 +47,7 @@ void mine_sweeper_game_screen_free(MineSweeperGameScreen* instance); * * @param instance MineSweeperGameScreen instance */ -void mine_sweeper_game_screen_reset(MineSweeperGameScreen* instance, uint8_t width, uint8_t height); +void mine_sweeper_game_screen_reset(MineSweeperGameScreen* instance, uint8_t width, uint8_t height, uint8_t difficulty); /** Get MineSweeperGameScreen view *