From 1882f57c57466dd6b3dc921c0d216bd2b1f2e6b9 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 19 Aug 2022 12:42:47 +0200 Subject: [PATCH] =?UTF-8?q?Cambiado=20el=20m=C3=A9todo=20de=20gestion=20de?= =?UTF-8?q?=20las=20colisiones=20del=20jugador.=20En=20vez=20de=20recular?= =?UTF-8?q?=20ahora=20corrige?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/player.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/player.cpp b/source/player.cpp index e7a0f06..9e4556a 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -197,17 +197,11 @@ void Player::move() // Recoloca if (vx > 0) { - do - { - x--; - } while (checkMapCollisions()); + x -= ((int)x + w) % tile; } else { - do - { - x++; - } while (checkMapCollisions()); + x += tile - ((int)x % tile); } vx = 0.0f;