diff --git a/src/Game.cpp b/src/Game.cpp index 2fcaebb..a1702c3 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -74,10 +74,10 @@ void Game::setupLevel() { const int specialBrickInterval = totalBricks / totalSpecialBricks; - constexpr float xSpacing = 20.f; - constexpr float ySpacing = 20.f; - const float xOffset = brickSize.x + xSpacing; - const float yOffset = brickSize.y + ySpacing; + constexpr int xSpacing = 20; + constexpr int ySpacing = 20; + const int xOffset = (int)brickSize.x + xSpacing; + const int yOffset = (int)brickSize.y + ySpacing; const int numRows = window.getSize().x / xOffset; const int numColumns = (window.getSize().y - 300)/ yOffset; int row{}; @@ -600,7 +600,7 @@ void Game::soundSystem() void Game::scoreSystem() { - player.mult = std::max(balls.size(), 1ul); + player.mult = (int)std::max(balls.size(), 1ull); for (auto& brick : bricks) { if (!brick.alive) diff --git a/src/Physics.cpp b/src/Physics.cpp index 6db40ee..7992b2c 100644 --- a/src/Physics.cpp +++ b/src/Physics.cpp @@ -22,7 +22,7 @@ sf::Vector2f velocityInRandomDir(const float speed_in) // get angle within certain ranges so that the ball does not // start moving straight side to side or up and down - sf::Angle angle = sf::degrees(upOrDown ? Random::get(225, 315) : Random::get(45, 135)); + sf::Angle angle = sf::degrees(upOrDown ? (float)Random::get(225, 315) : (float)Random::get(45, 135)); if (angle.asDegrees() == 90.f || angle.asDegrees() == 270) { angle += sf::degrees(1);