Scoreboard: colorets al param.h
This commit is contained in:
@@ -24,6 +24,10 @@ scoreboard.rect.x 0
|
||||
scoreboard.rect.y 200
|
||||
scoreboard.rect.w 320
|
||||
scoreboard.rect.h 40
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
|
||||
## --- TITLE ---
|
||||
title.press_start_position 170
|
||||
|
||||
@@ -24,6 +24,10 @@ scoreboard.rect.x 0
|
||||
scoreboard.rect.y 216
|
||||
scoreboard.rect.w 320
|
||||
scoreboard.rect.h 40
|
||||
scoreboard.separator_color 0D1A2B
|
||||
scoreboard.easy_color 4B692F
|
||||
scoreboard.normal_color 2E3F47
|
||||
scoreboard.hard_color 76428A
|
||||
|
||||
## --- TITLE ---
|
||||
title.press_start_position 180
|
||||
|
||||
@@ -188,39 +188,39 @@ void Credits::fillTextTexture()
|
||||
int y = (param.game.height - TEXTS_HEIGHT) / 2;
|
||||
y = 0;
|
||||
text->setPalette(1);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(0), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(0), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
text->setPalette(0);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
y += SPACE_PRE_TITLE;
|
||||
text->setPalette(1);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(1), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(1), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->setPalette(0);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
y += SPACE_PRE_TITLE;
|
||||
text->setPalette(1);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(2), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(2), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->setPalette(0);
|
||||
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(5), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(5), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(6), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(6), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
y += SPACE_PRE_TITLE;
|
||||
text->setPalette(1);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(3), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(3), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->setPalette(0);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(7), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(7), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(8), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(8), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
y += SPACE_POST_TITLE;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(9), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(9), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
// Mini logo
|
||||
y += SPACE_PRE_TITLE;
|
||||
@@ -236,7 +236,7 @@ void Credits::fillTextTexture()
|
||||
|
||||
// Texto con el copyright
|
||||
y += mini_logo_sprite->getHeight() + 3;
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXT_COPYRIGHT, 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXT_COPYRIGHT, 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
// Resetea el renderizador
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), nullptr);
|
||||
|
||||
@@ -1693,7 +1693,7 @@ void Game::initDifficultyVars()
|
||||
{
|
||||
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[0]);
|
||||
difficulty_score_multiplier_ = 0.5f;
|
||||
scoreboard_->setColor(SCOREBOARD_EASY_COLOR);
|
||||
scoreboard_->setColor(param.scoreboard.easy_color);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1701,7 @@ void Game::initDifficultyVars()
|
||||
{
|
||||
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[0]);
|
||||
difficulty_score_multiplier_ = 1.0f;
|
||||
scoreboard_->setColor(SCOREBOARD_NORMAL_COLOR);
|
||||
scoreboard_->setColor(param.scoreboard.normal_color);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1709,7 +1709,7 @@ void Game::initDifficultyVars()
|
||||
{
|
||||
balloon_manager_->setDefaultBalloonSpeed(BALLOON_SPEED[4]);
|
||||
difficulty_score_multiplier_ = 1.5f;
|
||||
scoreboard_->setColor(SCOREBOARD_HARD_COLOR);
|
||||
scoreboard_->setColor(param.scoreboard.hard_color);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void HiScoreTable::render()
|
||||
Screen::get()->start();
|
||||
|
||||
// Limpia la pantalla
|
||||
Screen::get()->clean(BG_COLOR);
|
||||
Screen::get()->clean();
|
||||
|
||||
// Pinta el fondo
|
||||
background_->render();
|
||||
|
||||
@@ -157,10 +157,10 @@ void Instructions::fillTexture()
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, first_line, Lang::getText("[INSTRUCTIONS] 01"), 1, ORANGE_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
const int anchor1 = first_line + space_post_header;
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_between_lines * 0, Lang::getText("[INSTRUCTIONS] 02"), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_between_lines * 1, Lang::getText("[INSTRUCTIONS] 03"), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_new_paragraph + space_between_lines * 2, Lang::getText("[INSTRUCTIONS] 04"), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_new_paragraph + space_between_lines * 3, Lang::getText("[INSTRUCTIONS] 05"), 1, NO_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_between_lines * 0, Lang::getText("[INSTRUCTIONS] 02"), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_between_lines * 1, Lang::getText("[INSTRUCTIONS] 03"), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_new_paragraph + space_between_lines * 2, Lang::getText("[INSTRUCTIONS] 04"), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, anchor1 + space_new_paragraph + space_between_lines * 3, Lang::getText("[INSTRUCTIONS] 05"), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||
|
||||
// Escribe el texto de los objetos y sus puntos
|
||||
const int anchor2 = anchor1 + space_pre_header + space_new_paragraph + space_between_lines * 3;
|
||||
@@ -243,7 +243,7 @@ void Instructions::render()
|
||||
Screen::get()->start();
|
||||
|
||||
// Limpia la pantalla
|
||||
Screen::get()->clean(BG_COLOR);
|
||||
Screen::get()->clean();
|
||||
|
||||
// Dibuja el mosacico de fondo
|
||||
tiled_bg_->render();
|
||||
|
||||
@@ -257,7 +257,7 @@ void Intro::render()
|
||||
Screen::get()->start();
|
||||
|
||||
// Limpia la pantalla
|
||||
Screen::get()->clean(BG_COLOR);
|
||||
Screen::get()->clean();
|
||||
|
||||
// Dibuja el fondo
|
||||
tiled_bg_->render();
|
||||
|
||||
@@ -223,6 +223,26 @@ bool setParams(const std::string &var, const std::string &value)
|
||||
param.scoreboard.rect.h = std::stoi(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.separator_color")
|
||||
{
|
||||
param.scoreboard.separator_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.easy_color")
|
||||
{
|
||||
param.scoreboard.easy_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.normal_color")
|
||||
{
|
||||
param.scoreboard.normal_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
else if (var == "scoreboard.hard_color")
|
||||
{
|
||||
param.scoreboard.hard_color = Color::fromHex(value);
|
||||
}
|
||||
|
||||
// TITLE
|
||||
else if (var == "title.press_start_position")
|
||||
{
|
||||
|
||||
@@ -72,6 +72,10 @@ struct ParamNotification
|
||||
struct ParamScoreboard
|
||||
{
|
||||
SDL_FRect rect; // Posición y tamaño del marcador
|
||||
Color separator_color; // Color del separador
|
||||
Color easy_color; // Color del marcador segun la dificultad
|
||||
Color normal_color; // Color del marcador segun la dificultad
|
||||
Color hard_color; // Color del marcador segun la dificultad
|
||||
};
|
||||
|
||||
// --- Parámetros del menú de servicio ---
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "screen.h" // Para Screen
|
||||
#include "sprite.h" // Para Sprite
|
||||
#include "text.h" // Para Text, TEXT_CENTER, TEXT_COLOR
|
||||
#include "param.h"
|
||||
|
||||
// [SINGLETON] Hay que definir las variables estáticas, desde el .h sólo la hemos declarado
|
||||
Scoreboard *Scoreboard::scoreboard_ = nullptr;
|
||||
@@ -432,7 +433,7 @@ void Scoreboard::createPanelTextures()
|
||||
void Scoreboard::renderSeparator()
|
||||
{
|
||||
// Dibuja la linea que separa el marcador de la zona de juego
|
||||
SDL_SetRenderDrawColor(renderer_, SEPARATOR_COLOR.r, SEPARATOR_COLOR.g, SEPARATOR_COLOR.b, 255);
|
||||
SDL_SetRenderDrawColor(renderer_, param.scoreboard.separator_color.r, param.scoreboard.separator_color.g, param.scoreboard.separator_color.b, 255);
|
||||
SDL_RenderLine(renderer_, 0, 0, rect_.w, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ void Title::render()
|
||||
Screen::get()->start();
|
||||
|
||||
// Limpia la pantalla
|
||||
Screen::get()->clean(BG_COLOR);
|
||||
Screen::get()->clean();
|
||||
|
||||
// Dibuja el mosacico de fondo
|
||||
tiled_bg_->render();
|
||||
@@ -104,7 +104,7 @@ void Title::render()
|
||||
mini_logo_sprite_->render();
|
||||
|
||||
// Texto con el copyright
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, pos2, TEXT_COPYRIGHT, 1, NO_COLOR, 1, shadow);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, pos2, TEXT_COPYRIGHT, 1, NO_TEXT_COLOR, 1, shadow);
|
||||
}
|
||||
|
||||
if (state_ == TitleState::LOGO_FINISHED)
|
||||
@@ -112,7 +112,7 @@ void Title::render()
|
||||
// 'PRESS TO PLAY'
|
||||
if (counter_ % 50 > 14 && !define_buttons_->isEnabled())
|
||||
{
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, param.title.press_start_position, Lang::getText("[TITLE] PRESS_BUTTON_TO_PLAY"), 1, NO_COLOR, 1, shadow);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, param.title.press_start_position, Lang::getText("[TITLE] PRESS_BUTTON_TO_PLAY"), 1, NO_TEXT_COLOR, 1, shadow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ void Title::render()
|
||||
// 'PRESS TO PLAY'
|
||||
if (counter_ % 10 > 4 && !define_buttons_->isEnabled())
|
||||
{
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, param.title.press_start_position, Lang::getText("[TITLE] PRESS_BUTTON_TO_PLAY"), 1, NO_COLOR, 1, shadow);
|
||||
text_->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, param.title.press_start_position, Lang::getText("[TITLE] PRESS_BUTTON_TO_PLAY"), 1, NO_TEXT_COLOR, 1, shadow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,21 +171,21 @@ using ColorCycle = std::array<Color, 2 * COLOR_CYCLE_SIZE>;
|
||||
// --- Funciones utilitarias ---
|
||||
|
||||
// Colores
|
||||
constexpr Color BG_COLOR = Color(0X27, 0X27, 0X36);
|
||||
constexpr Color NO_COLOR = Color(0XFF, 0XFF, 0XFF);
|
||||
constexpr Color NO_TEXT_COLOR = Color(0XFF, 0XFF, 0XFF);
|
||||
constexpr Color SHADOW_TEXT_COLOR = Color(0X43, 0X43, 0X4F);
|
||||
constexpr Color SEPARATOR_COLOR = Color(0X0D, 0X1A, 0X2B);
|
||||
constexpr Color SCOREBOARD_EASY_COLOR = Color(0X4B, 0X69, 0X2F);
|
||||
constexpr Color SCOREBOARD_NORMAL_COLOR = Color(0X2E, 0X3F, 0X47);
|
||||
constexpr Color SCOREBOARD_HARD_COLOR = Color(0X76, 0X42, 0X8A);
|
||||
|
||||
constexpr Color FLASH_COLOR = Color(0XFF, 0XFF, 0XFF);
|
||||
|
||||
constexpr Color ORANGE_COLOR = Color(0XFF, 0X7A, 0X00);
|
||||
constexpr Color ORANGE_SOFT_COLOR = Color(0XFF, 0XA0, 0X33);
|
||||
constexpr Color ORANGE_SHADOW_COLOR = ORANGE_SOFT_COLOR.darken(100);
|
||||
|
||||
constexpr Color GREEN_COLOR = Color(0X5B, 0XEC, 0X95);
|
||||
|
||||
constexpr Color BLUE_SKY_COLOR = Color(0X02, 0X88, 0XD1);
|
||||
constexpr Color PINK_SKY_COLOR = Color(0XFF, 0X6B, 0X97);
|
||||
constexpr Color GREEN_SKY_COLOR = Color(0X00, 0X79, 0X6B);
|
||||
|
||||
constexpr Color DEBUG_COLOR = Color(0xFF, 0xFF, 0x00);
|
||||
|
||||
// Colores y gráficos
|
||||
|
||||
Reference in New Issue
Block a user