From 24126a2f13553d4fd516fb0dc727906b324e9c56 Mon Sep 17 00:00:00 2001 From: nathansmith117 Date: Tue, 14 May 2024 11:55:17 -0600 Subject: Nap time button added --- src/gameScreen.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/gameScreen.c') diff --git a/src/gameScreen.c b/src/gameScreen.c index bbe5a65..68c1301 100644 --- a/src/gameScreen.c +++ b/src/gameScreen.c @@ -41,6 +41,15 @@ void initGameScreen(GameScreen* gameScreen, Game* game) BLACK ); + // Nap Time stuff. + gameScreen->napTimeButton = createTexturedButton( + &assets->textures[NAP_TIME_TEXTURE], + (Rectangle){700.0, 5.0, 100.0, 50.0}, + "", + WHITE, + BLACK + ); + gameScreen->nextShootingStoneCount = RUN_SHOOTER_GAME_COUNT_START; initShop(&gameScreen->shop, game); @@ -223,12 +232,17 @@ void updateGameScreen(GameScreen* gameScreen, Game* game) snprintf(stonesBuf, sizeof(stonesBuf), "%d", game->stones); DrawText(stonesBuf, 40.0, 5.0, 30, BLACK); - // Shooter game time. + // Shooter game stuff. if (game->stones >= gameScreen->nextShootingStoneCount) { - ++game->stones; - enterShooterScreen(game); - gameScreen->nextShootingStoneCount *= 5.0; + + // Show button to enter nap time. + if (updateTexturedButton(&gameScreen->napTimeButton)) + { + ++game->stones; + enterShooterScreen(game); + gameScreen->nextShootingStoneCount *= 5.0; + } } char nextShooterBuf[60]; -- cgit v1.2.3