diff options
| author | nathan <nathansmith@disroot.org> | 2026-01-07 11:21:32 +0000 |
|---|---|---|
| committer | nathan <nathansmith@disroot.org> | 2026-01-07 11:21:32 +0000 |
| commit | 0180e40326f67ef465e1d865a0aed21162e0f5c5 (patch) | |
| tree | 2f72f94010920b0d9d9147620ed205f642720e3e /src/game.c | |
| parent | 0fb94d28d3f64e95ff228edbfd8fc17d420e215f (diff) | |
| download | FindThings-0180e40326f67ef465e1d865a0aed21162e0f5c5.tar.gz FindThings-0180e40326f67ef465e1d865a0aed21162e0f5c5.tar.bz2 FindThings-0180e40326f67ef465e1d865a0aed21162e0f5c5.zip | |
At place thingy
Diffstat (limited to 'src/game.c')
| -rw-r--r-- | src/game.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -212,16 +212,31 @@ void updateGameStatus(Game* game) float width; float height; int fontSize = 20; - int lineCount = 2; - int maxColumns = 16; + int lineCount = 3; + int maxColumns = 24; float maxWidth = maxColumns * fontSize / 2.0; - bool topBarStyle = game->screen.destination.x < maxWidth; + bool topBarStyle = game->screen.destination.x < maxWidth / 2.0; const char* spacer = topBarStyle ? ", " : "\n"; + // Format text. + char placeAt[ENTITY_NAME_MAX] = "Back woods"; + WorldUID place = game->player.place; + + if (place != ENTITY_NONE) + { + strncpy(placeAt, getEntityName(game->world.entities[place].id), + ENTITY_NAME_MAX - 1); + } + const char* text = TextFormat( - "Speed %d kps%sPee level: 7", (int)roundf(game->player.speed), spacer); + "At: %s%sSpeed %d%sPee level: 7", + placeAt, + spacer, + (int)roundf(game->player.speed), + spacer); + // Handle bar style. if (topBarStyle) // Top bar style. { x = 110.0; @@ -237,6 +252,7 @@ void updateGameStatus(Game* game) height = fontSize * lineCount; } + // Draw text and background. Color backgroundColor = PINK; backgroundColor.a = game->settings.statusAndInfoAlpha; DrawRectangle(x, y, width, height, backgroundColor); |
