Arreglado el problema con las plataormas verticales. Se iba un pixel

This commit is contained in:
2022-08-29 08:27:33 +02:00
parent 45592f16c3
commit f9482594ea
5 changed files with 7 additions and 7 deletions

View File

@@ -86,10 +86,10 @@ void Game::update()
}
}
map->update();
enemyEngine->update();
player->update();
checkScreenBorders();
enemyEngine->update();
map->update();
checkInput();
}
}

View File

@@ -149,8 +149,8 @@ bool Input::discoverGameController()
if (SDL_IsGameController(i))
numGamepads++;
printf("\nChecking for game controllers...\n");
printf("%i joysticks found, %i are gamepads\n", nJoysticks, numGamepads);
printf("** Checking for game controllers ...\n");
printf("%i joysticks found, %i are gamepads\n\n", nJoysticks, numGamepads);
if (numGamepads > 0)
{

View File

@@ -61,7 +61,7 @@ bool Map::load(std::string file_path)
if (file.good())
{
// Procesa el fichero linea a linea
printf("Reading file %s\n", filename.c_str());
printf("Reading file %s\n\n", filename.c_str());
while (std::getline(file, line))
{
// Si la linea contiene el texto [tilemap] se realiza el proceso de carga del fichero tmx

View File

@@ -300,7 +300,7 @@ void Player::move()
// Dejarlo alineado con la plataforma
state = standing;
vy = 0.0f;
y = -h + map->getActorCollider(hookedOnMovingPlatform).y;
y = map->getActorCollider(hookedOnMovingPlatform).y - h;
x += map->getActorIncX(hookedOnMovingPlatform);
isOnMovingPlatform();
}