Credits: retocs en els colors de fondo, el rectangle del borde i en els textos
This commit is contained in:
@@ -40,7 +40,7 @@ title.press_start_position 180 # Posición Y del texto "Press Start"
|
|||||||
title.title_duration 800 # Duración de la pantalla de título (frames)
|
title.title_duration 800 # Duración de la pantalla de título (frames)
|
||||||
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
title.arcade_edition_position 123 # Posición Y del subtítulo "Arcade Edition"
|
||||||
title.title_c_c_position 80 # Posición Y del título principal
|
title.title_c_c_position 80 # Posición Y del título principal
|
||||||
title.bg_color 988db3 # Color de fondo en la sección titulo
|
title.bg_color 39393F # Color de fondo en la sección titulo
|
||||||
|
|
||||||
## --- BACKGROUND ---
|
## --- BACKGROUND ---
|
||||||
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal)
|
||||||
@@ -76,7 +76,7 @@ service_menu.bg_color 000F00F5 # Color de fondo del menú de servicio (
|
|||||||
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
service_menu.drop_shadow false # ¿El menú de servicio tiene sombra?
|
||||||
|
|
||||||
## --- INTRO ---
|
## --- INTRO ---
|
||||||
intro.bg_color dbdb82 # Color de fondo de la intro
|
intro.bg_color 39393F # Color de fondo de la intro
|
||||||
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
intro.card_color CBDBFC # Color de las tarjetas en la intro
|
||||||
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
intro.shadow_color 00000080 # Color de la sombra de las tarjetas en la intro
|
||||||
intro.text_distance_from_bottom 48 # Posicion del texto
|
intro.text_distance_from_bottom 48 # Posicion del texto
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Director::Director(int argc, const char *argv[])
|
|||||||
Section::name = Section::Name::GAME;
|
Section::name = Section::Name::GAME;
|
||||||
Section::options = Section::Options::GAME_PLAY_1P;
|
Section::options = Section::Options::GAME_PLAY_1P;
|
||||||
#elif DEBUG
|
#elif DEBUG
|
||||||
Section::name = Section::Name::INTRO;
|
Section::name = Section::Name::CREDITS;
|
||||||
Section::options = Section::Options::GAME_PLAY_1P;
|
Section::options = Section::Options::GAME_PLAY_1P;
|
||||||
#else // NORMAL GAME
|
#else // NORMAL GAME
|
||||||
Section::name = Section::Name::LOGO;
|
Section::name = Section::Name::LOGO;
|
||||||
|
|||||||
@@ -169,35 +169,39 @@ void Credits::fillTextTexture()
|
|||||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 0);
|
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 0);
|
||||||
SDL_RenderClear(Screen::get()->getRenderer());
|
SDL_RenderClear(Screen::get()->getRenderer());
|
||||||
|
|
||||||
const std::array<std::string, 10> TEXTS = {
|
const std::array<std::string, 11> TEXTS = {
|
||||||
Lang::getText("[CREDITS] PROGRAMMED_AND_DESIGNED_BY"),
|
Lang::getText("[CREDITS] PROGRAMMED_AND_DESIGNED_BY"),
|
||||||
Lang::getText("[CREDITS] PIXELART_DRAWN_BY"),
|
Lang::getText("[CREDITS] PIXELART_DRAWN_BY"),
|
||||||
Lang::getText("[CREDITS] MUSIC_COMPOSED_BY"),
|
Lang::getText("[CREDITS] MUSIC_COMPOSED_BY"),
|
||||||
Lang::getText("[CREDITS] SOUND_EFFECTS"),
|
Lang::getText("[CREDITS] SOUND_EFFECTS"),
|
||||||
"JAILDESIGNER",
|
"JAILDESIGNER",
|
||||||
"JAILDOCTOR (INTRO)",
|
"JAILDOCTOR",
|
||||||
"ERIC MATYAS (SOUNDIMAGE.ORG)",
|
"ERIC MATYAS (SOUNDIMAGE.ORG)",
|
||||||
"WWW.THEMOTIONMONKEY.CO.UK",
|
"WWW.THEMOTIONMONKEY.CO.UK",
|
||||||
"WWW.KENNEY.NL",
|
"WWW.KENNEY.NL",
|
||||||
"JAILDOCTOR"};
|
"JAILDOCTOR",
|
||||||
|
"JAILDESIGNER"};
|
||||||
|
|
||||||
const int SPACE_POST_TITLE = 3 + text->getCharacterSize();
|
const int SPACE_POST_TITLE = 3 + text->getCharacterSize();
|
||||||
const int SPACE_PRE_TITLE = text->getCharacterSize() * 4;
|
const int SPACE_PRE_TITLE = text->getCharacterSize() * 4;
|
||||||
const int TEXTS_HEIGHT = 1 * text->getCharacterSize() + 7 * SPACE_POST_TITLE + 3 * SPACE_PRE_TITLE;
|
const int TEXTS_HEIGHT = 1 * text->getCharacterSize() + 8 * SPACE_POST_TITLE + 3 * SPACE_PRE_TITLE;
|
||||||
credits_rect_dst_.h = credits_rect_src_.h = TEXTS_HEIGHT;
|
credits_rect_dst_.h = credits_rect_src_.h = TEXTS_HEIGHT;
|
||||||
|
|
||||||
int y = (param.game.height - TEXTS_HEIGHT) / 2;
|
int y = (param.game.height - TEXTS_HEIGHT) / 2;
|
||||||
|
// PROGRAMMED_AND_DESIGNED_BY
|
||||||
y = 0;
|
y = 0;
|
||||||
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(0), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(0), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||||
|
|
||||||
y += SPACE_POST_TITLE;
|
y += SPACE_POST_TITLE;
|
||||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_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);
|
||||||
|
|
||||||
|
// PIXELART_DRAWN_BY
|
||||||
y += SPACE_PRE_TITLE;
|
y += SPACE_PRE_TITLE;
|
||||||
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(1), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(1), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||||
y += SPACE_POST_TITLE;
|
y += SPACE_POST_TITLE;
|
||||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(4), 1, NO_TEXT_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);
|
||||||
|
|
||||||
|
// MUSIC_COMPOSED_BY
|
||||||
y += SPACE_PRE_TITLE;
|
y += SPACE_PRE_TITLE;
|
||||||
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(2), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(2), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||||
|
|
||||||
@@ -206,6 +210,7 @@ void Credits::fillTextTexture()
|
|||||||
y += SPACE_POST_TITLE;
|
y += SPACE_POST_TITLE;
|
||||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(6), 1, NO_TEXT_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);
|
||||||
|
|
||||||
|
// SOUND_EFFECTS
|
||||||
y += SPACE_PRE_TITLE;
|
y += SPACE_PRE_TITLE;
|
||||||
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(3), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
text_grad->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(3), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||||
y += SPACE_POST_TITLE;
|
y += SPACE_POST_TITLE;
|
||||||
@@ -214,6 +219,8 @@ void Credits::fillTextTexture()
|
|||||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(8), 1, NO_TEXT_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;
|
y += SPACE_POST_TITLE;
|
||||||
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(9), 1, NO_TEXT_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);
|
||||||
|
y += SPACE_POST_TITLE;
|
||||||
|
text->writeDX(TEXT_CENTER | TEXT_SHADOW, param.game.game_area.center_x, y, TEXTS.at(10), 1, NO_TEXT_COLOR, 1, SHADOW_TEXT_COLOR);
|
||||||
|
|
||||||
// Mini logo
|
// Mini logo
|
||||||
y += SPACE_PRE_TITLE;
|
y += SPACE_PRE_TITLE;
|
||||||
@@ -267,7 +274,9 @@ void Credits::fillCanvas()
|
|||||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &right_black_rect_);
|
SDL_RenderFillRect(Screen::get()->getRenderer(), &right_black_rect_);
|
||||||
|
|
||||||
// Dibuja el rectangulo rojo
|
// Dibuja el rectangulo rojo
|
||||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0, 0, 0xFF);
|
// SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0xFF, 0, 0, 0xFF);
|
||||||
|
const Color color = color_.lighten();
|
||||||
|
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, 0xFF);
|
||||||
SDL_RenderRect(Screen::get()->getRenderer(), &red_rect);
|
SDL_RenderRect(Screen::get()->getRenderer(), &red_rect);
|
||||||
|
|
||||||
// Si el mini_logo está en su destino, lo dibuja encima de lo anterior
|
// Si el mini_logo está en su destino, lo dibuja encima de lo anterior
|
||||||
@@ -490,15 +499,18 @@ void Credits::resetVolume()
|
|||||||
// Cambia el color del fondo
|
// Cambia el color del fondo
|
||||||
void Credits::cycleColors()
|
void Credits::cycleColors()
|
||||||
{
|
{
|
||||||
constexpr int UPPER_LIMIT = 255; // Límite superior
|
// constexpr int UPPER_LIMIT = 255; // Límite superior
|
||||||
constexpr int LOWER_LIMIT = 80; // Límite inferior
|
// constexpr int LOWER_LIMIT = 80; // Límite inferior
|
||||||
|
|
||||||
|
constexpr int UPPER_LIMIT = 140; // Límite superior
|
||||||
|
constexpr int LOWER_LIMIT = 30; // Límite inferior
|
||||||
|
|
||||||
static float r = static_cast<float>(UPPER_LIMIT);
|
static float r = static_cast<float>(UPPER_LIMIT);
|
||||||
static float g = static_cast<float>(LOWER_LIMIT);
|
static float g = static_cast<float>(LOWER_LIMIT);
|
||||||
static float b = static_cast<float>(LOWER_LIMIT);
|
static float b = static_cast<float>(LOWER_LIMIT);
|
||||||
static float stepR = -0.5f; // Paso flotante para transiciones suaves
|
static float stepR = -0.5f; // Paso flotante para transiciones suaves
|
||||||
static float stepG = 0.3f;
|
static float stepG = 0.3f;
|
||||||
static float stepB = 0.7f;
|
static float stepB = 0.1f;
|
||||||
|
|
||||||
// Ajustar valores de R
|
// Ajustar valores de R
|
||||||
r += stepR;
|
r += stepR;
|
||||||
@@ -522,7 +534,8 @@ void Credits::cycleColors()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Aplicar el color, redondeando a enteros antes de usar
|
// Aplicar el color, redondeando a enteros antes de usar
|
||||||
tiled_bg_->setColor(Color(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b)));
|
color_ = Color(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
||||||
|
tiled_bg_->setColor(color_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualza los jugadores
|
// Actualza los jugadores
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ private:
|
|||||||
// --- Diseño y posicionamiento ---
|
// --- Diseño y posicionamiento ---
|
||||||
float black_bars_size_ = (param.game.game_area.rect.h - PLAY_AREA_HEIGHT) / 2; // Tamaño de las barras negras
|
float black_bars_size_ = (param.game.game_area.rect.h - PLAY_AREA_HEIGHT) / 2; // Tamaño de las barras negras
|
||||||
int mini_logo_final_pos_ = 0; // Posición final del minilogo
|
int mini_logo_final_pos_ = 0; // Posición final del minilogo
|
||||||
|
Color color_; // Color usado para los efectos
|
||||||
|
|
||||||
// --- Control de audio ---
|
// --- Control de audio ---
|
||||||
int initial_volume_ = Options::audio.music.volume; // Volumen inicial
|
int initial_volume_ = Options::audio.music.volume; // Volumen inicial
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Instructions::Instructions()
|
|||||||
view_ = param.game.game_area.rect;
|
view_ = param.game.game_area.rect;
|
||||||
|
|
||||||
// Inicializa objetos
|
// Inicializa objetos
|
||||||
|
tiled_bg_->setColor(param.title.bg_color);
|
||||||
fade_->setColor(param.fade.color);
|
fade_->setColor(param.fade.color);
|
||||||
fade_->setType(FadeType::FULLSCREEN);
|
fade_->setType(FadeType::FULLSCREEN);
|
||||||
fade_->setPostDuration(param.fade.post_duration);
|
fade_->setPostDuration(param.fade.post_duration);
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include "writer.h" // Para Writer
|
#include "writer.h" // Para Writer
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
|
||||||
|
#include <iomanip> // Para std::hex, std::setw, std::setfill
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Intro::Intro()
|
Intro::Intro()
|
||||||
: tiled_bg_(std::make_unique<TiledBG>(param.game.game_area.rect, TiledBGMode::DIAGONAL))
|
: tiled_bg_(std::make_unique<TiledBG>(param.game.game_area.rect, TiledBGMode::DIAGONAL))
|
||||||
@@ -49,46 +51,70 @@ void Intro::checkEvents()
|
|||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while (SDL_PollEvent(&event))
|
while (SDL_PollEvent(&event))
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1)
|
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1)
|
||||||
{
|
{
|
||||||
static Color color = Color(128, 128, 128);
|
static Color color = param.intro.bg_color;
|
||||||
switch (event.key.key)
|
switch (event.key.key)
|
||||||
{
|
{
|
||||||
case SDLK_A:
|
case SDLK_A:
|
||||||
++color.r;
|
if (color.r < 255)
|
||||||
if (color.r > 255)
|
++color.r;
|
||||||
color.r = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_Z:
|
case SDLK_Z:
|
||||||
--color.r;
|
if (color.r > 0)
|
||||||
if (color.r < 0)
|
--color.r;
|
||||||
color.r =255;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_S:
|
case SDLK_S:
|
||||||
++color.g;
|
if (color.g < 255)
|
||||||
|
++color.g;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_X:
|
case SDLK_X:
|
||||||
--color.g;
|
if (color.g > 0)
|
||||||
|
--color.g;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_D:
|
case SDLK_D:
|
||||||
++color.b;
|
if (color.b < 255)
|
||||||
|
++color.b;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDLK_C:
|
case SDLK_C:
|
||||||
--color.b;
|
if (color.b > 0)
|
||||||
|
--color.b;
|
||||||
|
|
||||||
|
case SDLK_F:
|
||||||
|
if (color.r < 255)
|
||||||
|
++color.r;
|
||||||
|
if (color.g < 255)
|
||||||
|
++color.g;
|
||||||
|
if (color.b < 255)
|
||||||
|
++color.b;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDLK_V:
|
||||||
|
if (color.r > 0)
|
||||||
|
--color.r;
|
||||||
|
if (color.g > 0)
|
||||||
|
--color.g;
|
||||||
|
if (color.b > 0)
|
||||||
|
--color.b;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tiled_bg_->setColor(color);
|
tiled_bg_->setColor(color);
|
||||||
std::cout << (int)color.r << "," << (int)color.g << "," << (int)color.b << std::endl;
|
std::cout << "#"
|
||||||
|
<< std::hex << std::setw(2) << std::setfill('0') << (int)color.r
|
||||||
|
<< std::setw(2) << std::setfill('0') << (int)color.g
|
||||||
|
<< std::setw(2) << std::setfill('0') << (int)color.b
|
||||||
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
GlobalEvents::check(event);
|
GlobalEvents::check(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user