Trabajando con el isOnFloor y los tiles passable
This commit is contained in:
@@ -198,7 +198,7 @@ bool Player::checkMapCollisions()
|
||||
// Mueve al jugador en función de la velocidad/desplazamiento
|
||||
void Player::move()
|
||||
{
|
||||
const int tile = map->getTileWidth();
|
||||
const int tile = map->getTileSize();
|
||||
|
||||
x += vx;
|
||||
if (checkMapCollisions())
|
||||
@@ -273,6 +273,11 @@ bool Player::isOnFloor()
|
||||
|
||||
updateFeet();
|
||||
|
||||
if (underFeet[0].y % map->getTileSize() != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto f : underFeet)
|
||||
{
|
||||
onFloor |= ((map->getTile(f) == wall) || (map->getTile(f) == passable));
|
||||
|
||||
Reference in New Issue
Block a user