Line drop by pixel

This commit is contained in:
2025-11-30 08:17:34 +01:00
parent 332e2efb74
commit 8279ccbe6d
3 changed files with 49 additions and 2 deletions

View File

@ -226,11 +226,12 @@ void GameRenderer::renderPlayingState(
// Draw the game board
const auto &board = game->boardRef();
for (int y = 0; y < Game::ROWS; ++y) {
float dropOffset = (lineEffect ? lineEffect->getRowDropOffset(y) : 0.0f);
for (int x = 0; x < Game::COLS; ++x) {
int v = board[y * Game::COLS + x];
if (v > 0) {
float bx = gridX + x * finalBlockSize;
float by = gridY + y * finalBlockSize;
float by = gridY + y * finalBlockSize + dropOffset;
drawBlockTexture(renderer, blocksTex, bx, by, finalBlockSize, v - 1);
}
}