Todavía falla MUCHO con las rampas

This commit is contained in:
2022-09-06 21:25:41 +02:00
parent 9af135100c
commit 247e0060ee
5 changed files with 21 additions and 12 deletions

View File

@@ -192,9 +192,11 @@ void Game::render()
// Pasa la información de debug
void Game::updateDebugInfo()
{
debug->add("MIRA! MIRA ELS SLOTS!");
debug->add("X = " + std::to_string((int)player->x) + ", Y = " + std::to_string((int)player->y));
debug->add("VX = " + std::to_string(player->vx) + ", VY = " + std::to_string(player->vy));
debug->add("VX = " + std::to_string(player->vx).substr(0,4) + ", VY = " + std::to_string(player->vy).substr(0,4));
debug->add("STATE = " + std::to_string(player->state));
debug->add("VEUS??");
}
// Pone la información de debug en pantalla
@@ -206,7 +208,7 @@ void Game::renderDebugInfo()
}
// Borra el marcador
SDL_Rect rect = {0, 17 * BLOCK, PLAY_AREA_WIDTH, GAMECANVAS_HEIGHT - PLAY_AREA_HEIGHT};
SDL_Rect rect = {0, 18 * BLOCK, PLAY_AREA_WIDTH, GAMECANVAS_HEIGHT - PLAY_AREA_HEIGHT};
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderFillRect(renderer, &rect);
@@ -227,7 +229,7 @@ void Game::renderDebugInfo()
SDL_RenderFillRect(renderer, &rect);
// Pinta el texto
debug->setPos({1, 17 * 8});
debug->setPos({1, 18 * 8});
debug->render();
}
@@ -235,12 +237,12 @@ void Game::renderDebugInfo()
void Game::renderRoomName()
{
// Texto en el centro de la pantalla
SDL_Rect rect = {0, 16 * BLOCK, PLAY_AREA_WIDTH, BLOCK};
color_t color = stringToColor("bright_black");
SDL_Rect rect = {0, 16 * BLOCK, PLAY_AREA_WIDTH, BLOCK * 2};
color_t color = stringToColor("white");
SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, 0xFF);
SDL_RenderFillRect(renderer, &rect);
text->writeCentered(GAMECANVAS_CENTER_X, 16 * 8, room->getName());
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, 16 * 8 + 4, room->getName(), 1, room->getBGColor());
}
// Cambia de habitación