diff --git a/dependencies/testproject_featuredemo.cpp b/dependencies/testproject_featuredemo.cpp index 7c6eb881cb6efedb487dcaee7440e1141ea5c556..74219b22f3a3cadddcab590c33f6cf44952afdb7 100644 --- a/dependencies/testproject_featuredemo.cpp +++ b/dependencies/testproject_featuredemo.cpp @@ -65,8 +65,8 @@ int main(int argc, char* argv[]) { std::vector<Ball> circles; circles.resize(5000); for (unsigned int i = 0; i < circles.size(); i++) { - circles.at(i).x = randint(0, window.width()); - circles.at(i).y = randint(0, window.height()); + circles.at(i).x = randint(0, window.get_width()); + circles.at(i).y = randint(0, window.get_height()); circles.at(i).radius = randint(5, 10); circles.at(i).xSpeed = float(randint(-400, 400)) / 100.0f; circles.at(i).ySpeed = float(randint(-400, 400)) / 100.0f; @@ -94,8 +94,8 @@ int main(int argc, char* argv[]) { window.draw_image(mousePosition, image); bool allAtCenter = true; for (Ball& ball : circles) { - float gravityX = (float(window.width()) / 2.0f) - ball.x; - float gravityY = (float(window.height()) / 2.0f) - ball.y; + float gravityX = (float(window.get_width()) / 2.0f) - ball.x; + float gravityY = (float(window.get_height()) / 2.0f) - ball.y; float absoluteSpeed = std::max(std::sqrt(gravityX * gravityX + gravityY * gravityY), 3.0f); const float gravity = 0.07f; ball.xSpeed += (gravityX / absoluteSpeed) * gravity; @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) { } else if(ball.y + ball.radius < 0) { ball.y = window.h() + ball.radius; }*/ - if ((std::abs(ball.x - float(window.width()) / 2.0f) > 1.0f) && (std::abs(ball.y - float(window.height()) / 2.0f) > 1.0f)) { + if ((std::abs(ball.x - float(window.get_width()) / 2.0f) > 1.0f) && (std::abs(ball.y - float(window.get_height()) / 2.0f) > 1.0f)) { allAtCenter = false; } window.draw_circle({int(ball.x), int(ball.y)}, ball.radius, ball.colour, TDT4102::Color::black);