Skip to content

Commit

Permalink
Update main.cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanrs authored Apr 10, 2020
1 parent 771e0ab commit 02ff2b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dogplay/src/main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const int arrowsSpeed = 10;
const int numberOfBombs = 12;
const int minScore = -3;
const unsigned int bombsDuration = 3; // in seconds
unsigned int bombsDigits = numberOfBombs ? (unsigned int)std::log(numberOfBombs) + 1 : 1;
unsigned int bombsDigits = numberOfBombs ? (unsigned int)std::log10(numberOfBombs) + 1 : 1;
sf::Vector2f generateRandomPosition(sf::Sprite const& sprite, sf::Vector2u const& windowDimensions){
unsigned int width = sprite.getGlobalBounds().width;
unsigned int height = sprite.getGlobalBounds().height;
Expand Down Expand Up @@ -161,7 +161,7 @@ int main(){
);
loose = true;
} else {
char scoreString[(score ? (unsigned int)std::log(score) + 1 : 1) + 7];
char scoreString[(score ? (unsigned int)std::log10(score) + 1 : 1) + 7];
sprintf(scoreString, "score:%d", score);
scoreDisplay.setString(scoreString);
}
Expand Down

0 comments on commit 02ff2b4

Please sign in to comment.