small update

This commit is contained in:
Joseph Aquino 2025-09-24 19:09:29 -04:00
parent 76ef3cdd0b
commit c09038de2e
2 changed files with 5 additions and 4 deletions

View File

@ -38,6 +38,7 @@ struct Player
sf::Vector2f previousPos{};
int score{};
int lives{3};
int mult{1};
bool left{false};
bool right{false};
};

View File

@ -525,7 +525,7 @@ void Game::render()
lives.setString("Lives: " + std::to_string(player.lives));
score.setString("Score: " + std::to_string(player.score));
currentMult.setString("Mult: x" + std::to_string(balls.size()));
currentMult.setString("Mult: x" + std::to_string(player.mult));
window.draw(lives);
window.draw(score);
@ -600,12 +600,12 @@ void Game::soundSystem()
void Game::scoreSystem()
{
const int mult = balls.size();
player.mult = std::max(balls.size(), 1ul);
for (auto& brick : bricks)
{
if (!brick.alive)
{
player.score += 100 * mult;
player.score += 100 * player.mult;
}
}
@ -613,7 +613,7 @@ void Game::scoreSystem()
{
if (!brick.alive)
{
player.score += 100 * mult;
player.score += 100 * player.mult;
}
}
}