diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-05-10 16:33:33 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-05-10 16:33:33 +0000 |
commit | fca307d6af08116f675e0d04e5ace2e353ec718c (patch) | |
tree | 9cc4d7ad1960f72ef8730f9260bd985867130419 | |
parent | 314b234fb1cc5a21bbcba414e7e9ffdeafd8a753 (diff) | |
download | PenguinYippies-fca307d6af08116f675e0d04e5ace2e353ec718c.tar.gz PenguinYippies-fca307d6af08116f675e0d04e5ace2e353ec718c.tar.bz2 PenguinYippies-fca307d6af08116f675e0d04e5ace2e353ec718c.zip |
Better stone count for shooter game
-rw-r--r-- | src/game.c | 2 | ||||
-rw-r--r-- | src/gameScreen.c | 9 | ||||
-rw-r--r-- | src/gameScreen.h | 4 | ||||
-rw-r--r-- | src/shooterScreen.c | 4 |
4 files changed, 14 insertions, 5 deletions
@@ -29,7 +29,7 @@ void initGame(Game* game) game->madeWithUnity = createAnimation(&game->assets.animations[MADE_WITH_UNITY_ANIMATION], 0.2); game->madeWithUnity.repeat = false; - playAnimation(&game->madeWithUnity); + //playAnimation(&game->madeWithUnity); } void updateGame(Game* game) diff --git a/src/gameScreen.c b/src/gameScreen.c index 4833bc7..cc50f2e 100644 --- a/src/gameScreen.c +++ b/src/gameScreen.c @@ -33,6 +33,8 @@ void initGameScreen(GameScreen* gameScreen, Game* game) BLACK ); + gameScreen->nextShootingStoneCount = RUN_SHOOTER_GAME_COUNT_START; + initShop(&gameScreen->shop, game); setGameScreenTool(gameScreen, CLICKER_TOOL); @@ -200,12 +202,17 @@ void updateGameScreen(GameScreen* gameScreen, Game* game) DrawText(stonesBuf, 40.0, 5.0, 30, BLACK); // Shooter game time. - if (game->stones % RUN_SHOOTER_GAME_EVERY == 0 && game->stones >= RUN_SHOOTER_GAME_EVERY) + if (game->stones >= gameScreen->nextShootingStoneCount) { ++game->stones; enterShooterScreen(game); + gameScreen->nextShootingStoneCount *= 2.5; } + char nextShooterBuf[60]; + snprintf(nextShooterBuf, sizeof(nextShooterBuf), "Next sleepy time is at %d stones", gameScreen->nextShootingStoneCount); + DrawText(nextShooterBuf, 350.0, 5.0, 20, BLACK); + updateGameScreenNavigation(gameScreen, game); updateGameScreenTool(gameScreen, game); // This should go before tool bar update because of how clicks work. updateGameScreenToolBar(gameScreen, game); diff --git a/src/gameScreen.h b/src/gameScreen.h index a745051..e798569 100644 --- a/src/gameScreen.h +++ b/src/gameScreen.h @@ -7,7 +7,7 @@ #ifndef GAME_SCREEN_H #define GAME_SCREEN_H -#define RUN_SHOOTER_GAME_EVERY 100 +#define RUN_SHOOTER_GAME_COUNT_START 500 typedef enum GamePlayPlace { CLICKY_DESKTOP_PLACE, @@ -30,6 +30,8 @@ typedef struct GameScreen { Shop shop; ToolId tool; + + int nextShootingStoneCount; } GameScreen; void initGameScreen(GameScreen* gameScreen, Game* game); diff --git a/src/shooterScreen.c b/src/shooterScreen.c index 8df219b..14cb34d 100644 --- a/src/shooterScreen.c +++ b/src/shooterScreen.c @@ -205,10 +205,10 @@ void drawUIShooterScreen(ShooterScreen* shooterScreen, Game* game) { drawCrosshairShooterScreen(10, 2); - size_t bufSize = 100; + size_t bufSize = 256; char buf[bufSize]; - snprintf(buf, bufSize, "They are sleeping not dead (:\nTime playing: %d\nPenguins still awake: %d", + snprintf(buf, bufSize, "They are sleeping not dead (:\nTime playing: %d\nPenguins still awake: %d\n\n-w, a, s, d to move around\n-mouse to aim\n-and click to put a penguin to sleep", (int)(GetTime() - shooterScreen->startTime), SHOOTER_PENGUIN_COUNT - shooterScreen->killCount); |