diff --git a/DiveIntoC++11/1_Arkanoid/p9.cpp b/DiveIntoC++11/1_Arkanoid/p9.cpp index 4469c65..8ae3d14 100644 --- a/DiveIntoC++11/1_Arkanoid/p9.cpp +++ b/DiveIntoC++11/1_Arkanoid/p9.cpp @@ -153,13 +153,15 @@ int main() RenderWindow window{{windowWidth, windowHeight}, "Arkanoid - 9"}; window.setFramerateLimit(60); - + + Event event; while(true) { window.clear(Color::Black); - if(Keyboard::isKeyPressed(Keyboard::Key::Escape)) break; - + while(window.pollEvent(event)){ + if(Keyboard::isKeyPressed(Keyboard::Key::Escape)) window.close(); + } ball.update(); paddle.update(); testCollision(paddle, ball); @@ -178,4 +180,4 @@ int main() } return 0; -} \ No newline at end of file +}