Marcador transparente. Area de juego ocupa toda la pantalla

This commit is contained in:
2022-09-22 20:50:34 +02:00
parent 44c9bb0a44
commit 96c0ddf8ed
18 changed files with 238 additions and 141 deletions

View File

@@ -19,10 +19,10 @@
#define GAMECANVAS_HEIGHT 240
// Zona de juego
const int PLAY_AREA_X = 0;
const int PLAY_AREA_Y = (4 * BLOCK);
const int PLAY_AREA_X = (0 * BLOCK);
const int PLAY_AREA_Y = (0 * BLOCK);
const int PLAY_AREA_TOP = (0 * BLOCK);
const int PLAY_AREA_BOTTOM = (26 * BLOCK);
const int PLAY_AREA_BOTTOM = (30 * BLOCK);
const int PLAY_AREA_LEFT = (0 * BLOCK);
const int PLAY_AREA_RIGHT = (40 * BLOCK);
const int PLAY_AREA_WIDTH = PLAY_AREA_RIGHT - PLAY_AREA_LEFT;

View File

@@ -265,11 +265,10 @@ void Game::renderDebugInfo()
// Pinta mascaras
SDL_SetRenderDrawColor(renderer, 0, 255, 0, 192);
SDL_Rect rect = player->sprite->getRect();
rect.y += SCOREBOARD_HEIGHT;
SDL_RenderFillRect(renderer, &rect);
// Pinta el texto
debug->setPos({1, 1 + SCOREBOARD_HEIGHT});
debug->setPos({1, 1});
debug->render();
}

View File

@@ -6,7 +6,7 @@ Map::Map(std::string file, SDL_Renderer *renderer, Asset *asset, ItemTracker *it
// Inicializa variables
tile_size = 8;
map_width = 40;
map_height = 26;
map_height = 30;
name = file.substr(file.find_last_of("\\/") + 1);
enemy_file = "";
bgColor1 = bgColor2 = {0, 0, 0};
@@ -508,7 +508,6 @@ e_tile_map Map::getTile(SDL_Point p)
// Calcula el tile
const int tile = collisionmap[((y / tile_size) * map_width) + (x / tile_size)];
// Las 8 primeras filas son tiles de fondo
if (tile == 0)
{
return nothing;

View File

@@ -40,8 +40,7 @@ void ScoreBoard::fillTexture()
{
// Cambia el puntero del renderizador a la textura y la limpia
SDL_SetRenderTarget(renderer, layer);
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
SDL_SetRenderDrawColor(renderer, 0, 171, 159, 255);
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);
SDL_RenderClear(renderer);
// Escribe los textos