Wave incrementing
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include "systems.h"
|
||||
|
||||
#include "../game_state.h"
|
||||
@@ -74,7 +75,17 @@ void drawGameUI(Game *game, f32 dt) {
|
||||
BZ_UI_FLEX_ALIGN_CENTER |
|
||||
BZ_UI_FLEX_JUSTIFY_START
|
||||
});
|
||||
uiBaseLabel("Wave: 11 ", game->font, 0.5f, WHITE);
|
||||
char waveDisplay[32];
|
||||
if (game->waveInfo.started) {
|
||||
snprintf(waveDisplay, sizeof(waveDisplay), "Wave: %d ", game->waveInfo.number);
|
||||
} else {
|
||||
f32 startingIn = game->waveInfo.data.timeBeforeStart - game->waveInfo.elapsed;
|
||||
i32 min = startingIn / 60.0f;
|
||||
i32 sec = startingIn - (min * 60);
|
||||
snprintf(waveDisplay, sizeof(waveDisplay), "Wave %d starting in: %02d:%02d ",
|
||||
game->waveInfo.number + 1, min, sec);
|
||||
}
|
||||
uiBaseLabel(waveDisplay, game->font, 0.5f, WHITE);
|
||||
bzUIPopParent(UI); // topBarRight
|
||||
|
||||
bzUIPopParent(UI); // topBar
|
||||
@@ -301,7 +312,10 @@ void drawGameOverUI(Game *game, f32 dt) {
|
||||
.type = BZ_UI_LAYOUT_FLEX_BOX,
|
||||
.flags = BZ_UI_FLEX_DIR_COLUMN | BZ_UI_FLEX_ALIGN_CENTER
|
||||
});
|
||||
uiBaseLabel("You survived 10 rounds.\n\n", game->font, 0.8f, WHITE);
|
||||
char gameOverDisplay[32];
|
||||
snprintf(gameOverDisplay, sizeof(gameOverDisplay), "You survived %d waves.\n\n",
|
||||
game->waveInfo.number);
|
||||
uiBaseLabel(gameOverDisplay, game->font, 0.8f, WHITE);
|
||||
if (uiMainMenuButton("Exit", true)) {
|
||||
setScreen(game, SCREEN_MAIN_MENU);
|
||||
unloadMap(game);
|
||||
|
||||
Reference in New Issue
Block a user