aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornathansmith117 <thenathansmithsmith@gmail.com>2024-05-10 16:49:25 +0000
committernathansmith117 <thenathansmithsmith@gmail.com>2024-05-10 16:49:25 +0000
commit1b2a507416bc1fd8fd2bb07f94d8bcd096c19721 (patch)
tree11f53e8af7d00bbfe59feecc8e65a7401bcbd45b /src
parentfca307d6af08116f675e0d04e5ace2e353ec718c (diff)
downloadPenguinYippies-1b2a507416bc1fd8fd2bb07f94d8bcd096c19721.tar.gz
PenguinYippies-1b2a507416bc1fd8fd2bb07f94d8bcd096c19721.tar.bz2
PenguinYippies-1b2a507416bc1fd8fd2bb07f94d8bcd096c19721.zip
%50 increase thingy added
Diffstat (limited to 'src')
-rw-r--r--src/gameScreen.c6
-rw-r--r--src/shooterScreen.c12
-rw-r--r--src/shooterScreen.h1
-rw-r--r--src/shop.c4
4 files changed, 19 insertions, 4 deletions
diff --git a/src/gameScreen.c b/src/gameScreen.c
index cc50f2e..ea5e81d 100644
--- a/src/gameScreen.c
+++ b/src/gameScreen.c
@@ -160,6 +160,12 @@ void updateGameScreenToolBar(GameScreen* gameScreen, Game* game)
void updateGameScreen(GameScreen* gameScreen, Game* game)
{
+ // Test shooter.
+ // if (IsKeyPressed(KEY_S))
+ // {
+ // enterShooterScreen(game);
+ // }
+
// Draw background.
Texture background = game->assets.textures[MAIN_SCREEN_BACKGROUND_TEXTURE];
diff --git a/src/shooterScreen.c b/src/shooterScreen.c
index 14cb34d..24207ed 100644
--- a/src/shooterScreen.c
+++ b/src/shooterScreen.c
@@ -226,6 +226,8 @@ void drawShooterScreenEndLevel(ShooterScreen* shooterScreen, Game* game)
if (shooterScreen->pnps > shooterScreen->bestPNPS)
{
shooterScreen->bestPNPS = shooterScreen->pnps;
+ shooterScreen->highScoreBeat = true;
+ game->stones *= 1.5; // %50 stone increase.
}
}
@@ -233,11 +235,17 @@ void drawShooterScreenEndLevel(ShooterScreen* shooterScreen, Game* game)
size_t bufSize = 100;
char buf[bufSize];
- snprintf(buf, bufSize, "Level done with a penguin naps per seconds (pnps) of: %f\n\tBest npns this game: %f",
+ snprintf(buf, bufSize, "Level done with a penguin naps per seconds (pnps) of: %f\n Best npns this game: %f",
shooterScreen->pnps, shooterScreen->bestPNPS);
// Draw it.
DrawText(buf, WINDOW_WIDTH / 4.0, WINDOW_HEIGHT / 2.0, 25, BLACK);
+
+ // high score beat.
+ if (shooterScreen->highScoreBeat)
+ {
+ DrawText("For beating the high score you get a %50 stone increase!", 20.0, WINDOW_HEIGHT / 2.0 - 100.0, 40.0, BLACK);
+ }
}
void updateShooterScreen(ShooterScreen* shooterScreen, Game* game)
@@ -326,8 +334,8 @@ void resetShooterScreen(ShooterScreen* shooterScreen)
// Time.
shooterScreen->startTime = GetTime();
-
shooterScreen->atEndLevel = false;
+ shooterScreen->highScoreBeat = false;
}
void enterShooterScreen(Game* game)
diff --git a/src/shooterScreen.h b/src/shooterScreen.h
index 1c22814..54d11d2 100644
--- a/src/shooterScreen.h
+++ b/src/shooterScreen.h
@@ -56,6 +56,7 @@ typedef struct ShooterScreen {
bool atEndLevel;
double endLevelStartTime;
+ bool highScoreBeat;
} ShooterScreen;
void initShooterScreeen(ShooterScreen* shooterScreen, Game* game);
diff --git a/src/shop.c b/src/shop.c
index 98acb97..447f300 100644
--- a/src/shop.c
+++ b/src/shop.c
@@ -38,10 +38,10 @@ void initShop(Shop* shop, Game* game)
// Entries.
shop->penguinLol = LoadTextureFromImage(assets->animations[PENGUIN_LOL_ANIMATION].image);
- shop->entries[0] = (ShopEntry){&shop->penguinLol, 50, createPenguinLolCB};
+ shop->entries[0] = (ShopEntry){&shop->penguinLol, 100, createPenguinLolCB};
shop->clicker = LoadTextureFromImage(assets->animations[CLICKER_ANIMATION].image);
- shop->entries[1] = (ShopEntry){&shop->clicker, 70, createClicker};
+ shop->entries[1] = (ShopEntry){&shop->clicker, 200, createClicker};
}
void buyThingFromShop(Shop* shop, int id, Game* game)