Añadir tema RGB y actualizar documentación completa
- Añadido nuevo tema RGB con fondo blanco puro y colores matemáticos - Actualizado README.md con controles actuales y nuevas características - Reorganizada documentación de controles por categorías - Corregida información obsoleta (resolución, temas, problemas) - Añadido control KP_5 para selección directa del tema RGB - Mejorada visibilidad del texto adaptando colores por tema 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -54,5 +54,6 @@ enum class ColorTheme {
|
||||
SUNSET = 0, // Naranjas, rojos, amarillos, rosas
|
||||
OCEAN = 1, // Azules, turquesas, blancos
|
||||
NEON = 2, // Cian, magenta, verde lima, amarillo vibrante
|
||||
FOREST = 3 // Verdes, marrones, amarillos otoño
|
||||
FOREST = 3, // Verdes, marrones, amarillos otoño
|
||||
RGB = 4 // RGB puros y subdivisiones matemáticas (fondo blanco)
|
||||
};
|
||||
@@ -199,7 +199,7 @@ void Engine::handleEvents() {
|
||||
|
||||
case SDLK_T:
|
||||
// Ciclar al siguiente tema
|
||||
current_theme_ = static_cast<ColorTheme>((static_cast<int>(current_theme_) + 1) % 4);
|
||||
current_theme_ = static_cast<ColorTheme>((static_cast<int>(current_theme_) + 1) % (sizeof(themes_) / sizeof(themes_[0])));
|
||||
initBalls(scenario_); // Regenerar bolas con nueva paleta
|
||||
break;
|
||||
|
||||
@@ -224,6 +224,11 @@ void Engine::handleEvents() {
|
||||
initBalls(scenario_);
|
||||
break;
|
||||
|
||||
case SDLK_KP_5:
|
||||
current_theme_ = ColorTheme::RGB;
|
||||
initBalls(scenario_);
|
||||
break;
|
||||
|
||||
case SDLK_1:
|
||||
scenario_ = 0;
|
||||
initBalls(scenario_);
|
||||
@@ -313,22 +318,26 @@ void Engine::render() {
|
||||
}
|
||||
|
||||
if (show_text_) {
|
||||
dbg_print(text_pos_, 8, text_.c_str(), 255, 255, 255);
|
||||
|
||||
// Mostrar nombre del tema en castellano debajo del número de pelotas
|
||||
std::string theme_names_es[] = {"ATARDECER", "OCEANO", "NEON", "BOSQUE"};
|
||||
std::string theme_name = theme_names_es[static_cast<int>(current_theme_)];
|
||||
int theme_text_width = static_cast<int>(theme_name.length() * 8); // 8 píxeles por carácter
|
||||
int theme_x = (current_screen_width_ - theme_text_width) / 2; // Centrar horizontalmente
|
||||
|
||||
// Colores acordes a cada tema
|
||||
// Colores acordes a cada tema (para texto del número de pelotas y nombre del tema)
|
||||
int theme_colors[][3] = {
|
||||
{255, 140, 60}, // ATARDECER: Naranja cálido
|
||||
{80, 200, 255}, // OCEANO: Azul océano
|
||||
{255, 60, 255}, // NEON: Magenta brillante
|
||||
{100, 255, 100} // BOSQUE: Verde natural
|
||||
{100, 255, 100}, // BOSQUE: Verde natural
|
||||
{100, 100, 100} // RGB: Gris oscuro (para contraste con fondo blanco)
|
||||
};
|
||||
int theme_idx = static_cast<int>(current_theme_);
|
||||
|
||||
// Texto del número de pelotas con color del tema
|
||||
dbg_print(text_pos_, 8, text_.c_str(), theme_colors[theme_idx][0], theme_colors[theme_idx][1], theme_colors[theme_idx][2]);
|
||||
|
||||
// Mostrar nombre del tema en castellano debajo del número de pelotas
|
||||
std::string theme_names_es[] = {"ATARDECER", "OCEANO", "NEON", "BOSQUE", "RGB"};
|
||||
std::string theme_name = theme_names_es[static_cast<int>(current_theme_)];
|
||||
int theme_text_width = static_cast<int>(theme_name.length() * 8); // 8 píxeles por carácter
|
||||
int theme_x = (current_screen_width_ - theme_text_width) / 2; // Centrar horizontalmente
|
||||
|
||||
// Texto del nombre del tema con el mismo color
|
||||
dbg_print(theme_x, 24, theme_name.c_str(), theme_colors[theme_idx][0], theme_colors[theme_idx][1], theme_colors[theme_idx][2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
};
|
||||
|
||||
// Temas de colores definidos
|
||||
ThemeColors themes_[4] = {
|
||||
ThemeColors themes_[5] = {
|
||||
// SUNSET: Naranjas, rojos, amarillos, rosas
|
||||
{180.0f / 255.0f, 140.0f / 255.0f, 100.0f / 255.0f, // Fondo superior (naranja suave)
|
||||
40.0f / 255.0f, 20.0f / 255.0f, 60.0f / 255.0f, // Fondo inferior (púrpura oscuro)
|
||||
@@ -89,7 +89,11 @@ private:
|
||||
// FOREST: Verdes, marrones, amarillos otoño
|
||||
{144.0f / 255.0f, 238.0f / 255.0f, 144.0f / 255.0f, // Fondo superior (verde claro)
|
||||
101.0f / 255.0f, 67.0f / 255.0f, 33.0f / 255.0f, // Fondo inferior (marrón tierra)
|
||||
{{34, 139, 34}, {107, 142, 35}, {154, 205, 50}, {255, 215, 0}, {210, 180, 140}, {160, 82, 45}, {218, 165, 32}, {50, 205, 50}}}
|
||||
{{34, 139, 34}, {107, 142, 35}, {154, 205, 50}, {255, 215, 0}, {210, 180, 140}, {160, 82, 45}, {218, 165, 32}, {50, 205, 50}}},
|
||||
// RGB: Colores RGB puros y subdivisiones matemáticas
|
||||
{1.0f, 1.0f, 1.0f, // Fondo superior (blanco puro)
|
||||
1.0f, 1.0f, 1.0f, // Fondo inferior (blanco puro) - sin degradado
|
||||
{{255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {0, 255, 255}, {255, 0, 255}, {128, 255, 128}, {255, 128, 128}}}
|
||||
};
|
||||
|
||||
// Batch rendering
|
||||
|
||||
Reference in New Issue
Block a user