From 0180e40326f67ef465e1d865a0aed21162e0f5c5 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 7 Jan 2026 04:21:32 -0700 Subject: At place thingy --- src/game.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/game.c') diff --git a/src/game.c b/src/game.c index fb5566d..fb7e01d 100644 --- a/src/game.c +++ b/src/game.c @@ -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); -- cgit v1.2.3