small update
This commit is contained in:
parent
76ef3cdd0b
commit
c09038de2e
|
|
@ -38,6 +38,7 @@ struct Player
|
|||
sf::Vector2f previousPos{};
|
||||
int score{};
|
||||
int lives{3};
|
||||
int mult{1};
|
||||
bool left{false};
|
||||
bool right{false};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue