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(); player->update();
checkScreenBorders(); checkScreenBorders();
enemyEngine->update();
map->update();
checkInput(); checkInput();
} }
} }

View File

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

View File

@@ -61,7 +61,7 @@ bool Map::load(std::string file_path)
if (file.good()) if (file.good())
{ {
// Procesa el fichero linea a linea // 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)) while (std::getline(file, line))
{ {
// Si la linea contiene el texto [tilemap] se realiza el proceso de carga del fichero tmx // 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 // Dejarlo alineado con la plataforma
state = standing; state = standing;
vy = 0.0f; vy = 0.0f;
y = -h + map->getActorCollider(hookedOnMovingPlatform).y; y = map->getActorCollider(hookedOnMovingPlatform).y - h;
x += map->getActorIncX(hookedOnMovingPlatform); x += map->getActorIncX(hookedOnMovingPlatform);
isOnMovingPlatform(); isOnMovingPlatform();
} }

View File

@@ -1,5 +1,5 @@
## TAREAS ## TAREAS
(A) Plataformas moviles verticales: se ha de enganchar a la vy para no verse afectado por la gravedad (A) Plataformas moviles verticales: se ha de enganchar a la vy para no verse afectado por la gravedad {cm:2022-08-29}
(A) Plataformas moviles horizontales: que no te empujen (A) Plataformas moviles horizontales: que no te empujen
(B) Plantearse hasta cuanto puede estar fuera el personaje de una plataforma. Ahora mismo con un pixel se aguanta dentro (B) Plantearse hasta cuanto puede estar fuera el personaje de una plataforma. Ahora mismo con un pixel se aguanta dentro
(A) Colisiones más alla del mapa. Si al otro lado del mapa hay una pared, ahora mismo hace cosas raras (A) Colisiones más alla del mapa. Si al otro lado del mapa hay una pared, ahora mismo hace cosas raras