From b83330053dccdd2fb827bd4f16b5d9c0e22d0114 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Wed, 12 Nov 2025 12:39:29 -0500 Subject: [PATCH] wip --- src/engine.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index 2686fa6..30395a2 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -79,7 +79,6 @@ void Engine::run() { last_clock_update = current_time; } std::cout << std::format("Time left: {}, Score ({}, {})\n", clock, score.x, score.y); - // std::cout << "Time left: " << clock << ", Score ( " << score.x << " : " << score.y << " )\n"; std::this_thread::sleep_for(std::chrono::milliseconds(150)); // 1000 / fps; 200ms = 5fps } } @@ -108,10 +107,8 @@ bool Engine::exit_process() { } bool Engine::move_ball() { - if(ball.y <= 0 || ball.y >= ROW - 1) { - ball_direction.y *= -1; - } - if(ball.x <= 0 || ball.x >= COL - 1) return false; + if(ball.y <= 0 || ball.y >= ROW - 1) { ball_direction.y *= -1; } + else if(ball.x <= 0 || ball.x >= COL - 1) return false; ball.x += ball_direction.x; ball.y += ball_direction.y; return true;