added stars to gameplay grid

This commit is contained in:
2025-11-30 14:00:32 +01:00
parent 55c40f0516
commit 9ea0183339
6 changed files with 54 additions and 14 deletions

View File

@ -6,6 +6,10 @@
#include <array>
#include <cmath>
#include <cstdio>
#include <random>
#include <vector>
namespace {
// Color constants (copied from main.cpp)
static const SDL_Color COLORS[] = {
@ -217,6 +221,12 @@ void GameRenderer::renderPlayingState(
float lineY = gridY + y * finalBlockSize;
SDL_RenderLine(renderer, gridX, lineY, gridX + GRID_W, lineY);
}
Uint64 nowTicks = SDL_GetTicks();
float deltaSeconds = (g_lastSparkTick == 0) ? (1.0f / 60.0f) : static_cast<float>(nowTicks - g_lastSparkTick) / 1000.0f;
g_lastSparkTick = nowTicks;
updateSparks(std::max(0.0f, deltaSeconds));
drawSparks(renderer, gridX, gridY, finalBlockSize);
// Draw block statistics panel border
drawRectWithOffset(statsX - 3 - contentOffsetX, statsY - 3 - contentOffsetY, statsW + 6, statsH + 6, {100, 120, 200, 255});