Empezando a trabajar con los enemigos
This commit is contained in:
@@ -132,11 +132,7 @@ bool Map::setVars(std::string var, std::string value)
|
||||
// Indicador de éxito en la asignación
|
||||
bool success = true;
|
||||
|
||||
if (var == "bg_img")
|
||||
{
|
||||
bg_img = value;
|
||||
}
|
||||
else if (var == "tileset_img")
|
||||
if (var == "tileset_img")
|
||||
{
|
||||
tileset_img = value;
|
||||
}
|
||||
@@ -176,10 +172,18 @@ void Map::fillMapTexture()
|
||||
SDL_RenderClear(renderer);
|
||||
|
||||
// Dibuja el degradado de fondo
|
||||
for (int i = 0; i < 208; i++)
|
||||
const int num_lines = 208;
|
||||
|
||||
const color_t color1 = {234, 171, 159};
|
||||
const color_t color2 = {144, 225, 231};
|
||||
|
||||
for (int i = 0; i < num_lines; i++)
|
||||
{
|
||||
SDL_SetRenderDrawColor(renderer, 234, 171, 159, 0xFF);
|
||||
SDL_SetRenderDrawColor(renderer, 144, 225, 231, 0xFF);
|
||||
float step = ((float)i / (float)num_lines);
|
||||
int r = color1.r + ((color2.r - color1.r) * step);
|
||||
int g = color1.g + ((color2.g - color1.g) * step);
|
||||
int b = color1.b + ((color2.b - color1.b) * step);
|
||||
SDL_SetRenderDrawColor(renderer, r, g, b, 0xFF);
|
||||
SDL_RenderDrawLine(renderer, 0, i, 320, i);
|
||||
}
|
||||
|
||||
@@ -205,6 +209,7 @@ void Map::fillMapTexture()
|
||||
|
||||
// Dibuja el marco del marcador
|
||||
SDL_SetRenderDrawColor(renderer, 85, 50, 85, 0xFF);
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0xFF);
|
||||
SDL_Rect rect = {0, 208, 320, 32};
|
||||
SDL_RenderDrawRect(renderer, &rect);
|
||||
rect = {1, 209, 318, 30};
|
||||
|
||||
Reference in New Issue
Block a user