Trabajando en el marcador

This commit is contained in:
2022-09-22 21:39:41 +02:00
parent 96c0ddf8ed
commit 1d9e5ff27d
5 changed files with 35 additions and 22 deletions

View File

@@ -19,8 +19,8 @@ tileset=diamond.png
animation=diamond.ani animation=diamond.ani
width=16 width=16
height=16 height=16
x=13 x=14
y=17 y=12
[/diamond] [/diamond]
[diamond] [diamond]

View File

@@ -23,10 +23,10 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,2551,2552,2553,2554,2555,2556,2557,2558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,538,539,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,455,456,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,459,460,451,452,0,465,466,0,0,0,0,0,0,0,0,0,0,455,456,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,1501,1506,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,530,531,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,534,535,526,527,0,540,541,0,0,0,0,0,0,0,0,0,0,530,531,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1501,1502,1503,1504,1505,1506,0,0,0,0,0,0,0,0,0,0,1357,1358,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1501,1502,1503,1504,1505,1506,0,0,0,0,0,0,0,0,0,0,1357,1358,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1432,1433,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,0,0,0,0,0,0,0,0,0,0,0,1432,1433,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,463,464,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,2,3,79,0,0,0,0,0,0,0,166,167,0,0,463,464,0,0,0,0,0,
0,0,0,233,234,235,236,0,0,0,0,0,0,0,0,0,0,233,234,235,236,0,0,0,0,0,1351,1352,1353,1354,1355,1356,0,538,539,0,0,0,0,0, 0,0,0,233,234,235,236,0,0,0,0,0,0,0,0,0,0,0,5,81,82,8,0,0,0,0,1351,1352,1353,1354,1355,1356,0,538,539,0,0,0,0,0,
0,0,0,308,309,310,311,0,0,0,0,0,0,0,0,0,0,308,309,310,311,0,0,0,0,0,0,0,461,462,0,0,0,455,456,0,0,0,0,0, 0,0,0,308,309,310,311,0,0,0,0,306,307,0,0,0,0,0,80,81,82,83,0,0,0,0,0,0,461,462,0,0,0,455,456,0,0,0,0,0,
0,0,0,383,384,385,386,0,0,0,0,0,0,0,0,0,0,383,384,385,386,0,0,0,0,0,0,0,461,462,0,0,0,530,531,0,0,0,0,0, 0,0,0,383,384,385,386,0,0,0,0,381,382,0,0,0,0,80,81,82,81,82,83,0,241,242,243,0,461,462,0,0,0,530,531,0,0,0,0,0,
1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137, 1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,1136,1137,
1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212, 1211,1212,1211,1212,1211,1212,1211,1212,1211,1203,1204,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,1211,1212,
1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287 1286,1287,1286,1287,1286,1287,1286,1287,1286,1278,1279,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287,1286,1287
</data> </data>
</layer> </layer>
<layer id="2" name="colisiones" width="40" height="30"> <layer id="2" name="colisiones" width="40" height="30">
@@ -87,12 +87,12 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,5628,5628,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5628,5628,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5628,5628,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

View File

@@ -89,6 +89,8 @@ void Game::update()
// Comprueba los eventos de la cola // Comprueba los eventos de la cola
checkEventHandler(); checkEventHandler();
board.diamonds = player->diamonds;
// Actualiza los objetos // Actualiza los objetos
debug->clear(); debug->clear();
scoreboard->update(); scoreboard->update();

View File

@@ -30,7 +30,7 @@ Map::Map(std::string file, SDL_Renderer *renderer, Asset *asset, ItemTracker *it
if (map_layer1 == NULL) if (map_layer1 == NULL)
printf("Error: map_layer1 could not be created!\nSDL Error: %s\n", SDL_GetError()); printf("Error: map_layer1 could not be created!\nSDL Error: %s\n", SDL_GetError());
// Pinta el mapa de la habitación en la textura // Pinta el mapa en las texturas
fillMapTexture(); fillMapTexture();
} }

View File

@@ -43,6 +43,17 @@ void ScoreBoard::fillTexture()
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
// Pinta el degradado
const float num_lines = (SCOREBOARD_BOTTOM / 2) - SCOREBOARD_TOP;
for (int i = SCOREBOARD_TOP; i < SCOREBOARD_TOP + num_lines; i++)
{
float step = ((float)i / num_lines);
int alpha = 64 + ((0 - 64) * step);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, alpha);
SDL_RenderDrawLine(renderer, SCOREBOARD_LEFT, i, SCOREBOARD_RIGHT, i);
}
// Escribe los textos // Escribe los textos
text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8, "-LIVES-"); text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8, "-LIVES-");
text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8 + text->getCharacterSize(), std::to_string(board->lives)); text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_FIRST_QUARTER_X, 8 + text->getCharacterSize(), std::to_string(board->lives));