Primera implementacion de tiles atravesables. No funcionará si estan apilados

This commit is contained in:
2022-08-19 12:33:42 +02:00
parent 76696f9eb7
commit 0624cff845
6 changed files with 71 additions and 52 deletions

View File

@@ -99,7 +99,15 @@ void Game::render()
void Game::checkInput()
{
if (input->checkInput(INPUT_BUTTON_2, REPEAT_FALSE))
{
debug = !debug;
}
if (input->checkInput(INPUT_BUTTON_3, REPEAT_FALSE))
{
delete player;
player = new Player(renderer, asset, input, map);
}
}
// Muestra información de depuración
@@ -117,11 +125,17 @@ void Game::renderDebugInfo()
debugText->write(0, line, text, -1);
text = "VY " + std::to_string(player->vy) + " " + std::to_string(player->jumpStrenght);
debugText->write(0, line+=6, text, -1);
debugText->write(0, line += 6, text, -1);
text = "VX " + std::to_string(player->vx);
debugText->write(0, line+=6, text, -1);
debugText->write(0, line += 6, text, -1);
text = "jump_pressed " + std::to_string(player->jumpPressed);
debugText->write(0, line+=6, text, -1);
debugText->write(0, line += 6, text, -1);
text = "isOnFloor " + std::to_string(player->isOnFloor());
debugText->write(0, line += 6, text, -1);
text = "getTile " + std::to_string(player->map->getTile(player->collider[0]));
debugText->write(0, line += 6, text, -1);
}