From abc0ddb66105a1ab23627e3f3a7ece8987b4eaac Mon Sep 17 00:00:00 2001 From: andrea Date: Wed, 18 Mar 2026 20:49:25 +0100 Subject: [PATCH] fix collision state --- src/engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index b20db0f..97fc261 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -30,7 +30,7 @@ void Engine::run() { // score the point only if ball reached the edge if (this -> _check_pad_ball_collision(_p1) && bx == 1) { _ball.bounce_on_pad(); - _event= P2_COLLISION; + _event= P1_COLLISION; } else if (bx <= 0) { // p2 scores @@ -45,7 +45,7 @@ void Engine::run() { // score the point only if ball reached the edge if (this -> _check_pad_ball_collision(_p2) && bx == MATRIX_WIDTH-2) { _ball.bounce_on_pad(); - _event= P1_COLLISION; + _event= P2_COLLISION; } else if (bx >= MATRIX_WIDTH-1) { // p1 scores