diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-03-13 18:15:15 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-03-13 18:15:15 +0000 |
commit | a82d43089143337524c90b6e2d9df174466abdcb (patch) | |
tree | dfc2b8d9d2eadad9082dcacbbfc8cd6a60f8aff0 /src | |
parent | 8372a776ad2e06b99e4704403504ba74932276ec (diff) | |
download | PenguinYippies-a82d43089143337524c90b6e2d9df174466abdcb.tar.gz PenguinYippies-a82d43089143337524c90b6e2d9df174466abdcb.tar.bz2 PenguinYippies-a82d43089143337524c90b6e2d9df174466abdcb.zip |
Cost in shop added
Diffstat (limited to 'src')
-rw-r--r-- | src/shop.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -97,6 +97,7 @@ void updateShop(Shop* shop, Game* game) { Texture entryTexture = *shop->entries[i].texture; + // Draw the entry texture. DrawTexturePro( entryTexture, (Rectangle){0.0, 0.0, entryTexture.width, entryTexture.height}, @@ -121,7 +122,22 @@ void updateShop(Shop* shop, Game* game) } } + // Draw outline. DrawRectangleLinesEx(rects[i], 2, outlineColor); + + // Draw cost. + char costBuf[20]; + int cost = shop->entries[i].cost; + snprintf(costBuf, sizeof(costBuf), "%d", cost); + + Color costColor = BLACK; + + if (cost > game->stones) + { + costColor = RED; + } + + DrawText(costBuf, rects[i].x + rects[i].width + 2, rects[i].y + 10, 50, costColor); } } |