Plataformas moviles completadas

This commit is contained in:
2022-08-27 09:36:43 +02:00
parent 43c10d335b
commit 2e102160e6
9 changed files with 61 additions and 12 deletions

View File

@@ -21,14 +21,12 @@ void ActorMovingPlatform::checkPath()
if (sprite->getPosX() > p2.x || sprite->getPosX() < p1.x)
{
sprite->setVelX(sprite->getVelX() * (-1));
//sprite->flip();
}
// Comprueba los límites verticales
if (sprite->getPosY() > p2.y || sprite->getPosY() < p1.y)
{
sprite->setVelY(sprite->getVelY() * (-1));
//sprite->flip();
}
}