LoadingScreen: nous efectes de so. Millores acabades
This commit is contained in:
@@ -323,9 +323,11 @@ BITMAP|${PREFIX}/data/items/items.gif
|
|||||||
# ===================================================================
|
# ===================================================================
|
||||||
MUSIC|${PREFIX}/data/music/title.ogg
|
MUSIC|${PREFIX}/data/music/title.ogg
|
||||||
MUSIC|${PREFIX}/data/music/game.ogg
|
MUSIC|${PREFIX}/data/music/game.ogg
|
||||||
MUSIC|${PREFIX}/data/music/loading_sound1.ogg
|
MUSIC|${PREFIX}/data/music/loading_data1.ogg
|
||||||
MUSIC|${PREFIX}/data/music/loading_sound2.ogg
|
MUSIC|${PREFIX}/data/music/loading_data2.ogg
|
||||||
MUSIC|${PREFIX}/data/music/loading_sound3.ogg
|
MUSIC|${PREFIX}/data/music/loading_header.ogg
|
||||||
|
MUSIC|${PREFIX}/data/music/loading_screen_color.ogg
|
||||||
|
MUSIC|${PREFIX}/data/music/loading_screen_data.ogg
|
||||||
MUSIC|${PREFIX}/data/music/ending1.ogg
|
MUSIC|${PREFIX}/data/music/ending1.ogg
|
||||||
MUSIC|${PREFIX}/data/music/ending2.ogg
|
MUSIC|${PREFIX}/data/music/ending2.ogg
|
||||||
MUSIC|${PREFIX}/data/music/game_over.ogg
|
MUSIC|${PREFIX}/data/music/game_over.ogg
|
||||||
|
|||||||
BIN
data/music/loading_data1.ogg
Normal file
BIN
data/music/loading_data1.ogg
Normal file
Binary file not shown.
BIN
data/music/loading_data2.ogg
Normal file
BIN
data/music/loading_data2.ogg
Normal file
Binary file not shown.
BIN
data/music/loading_header.ogg
Normal file
BIN
data/music/loading_header.ogg
Normal file
Binary file not shown.
Binary file not shown.
@@ -91,28 +91,30 @@ void LoadingScreen::transitionToState(State new_state) {
|
|||||||
case State::HEADER1:
|
case State::HEADER1:
|
||||||
case State::HEADER2:
|
case State::HEADER2:
|
||||||
current_border_type_ = Border::RED_AND_CYAN;
|
current_border_type_ = Border::RED_AND_CYAN;
|
||||||
// Reproducir sonido de cargar el header
|
Audio::get()->playMusic("loading_header.ogg", 0);
|
||||||
Audio::get()->playMusic("loading_sound1.ogg");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State::DATA1:
|
case State::DATA1:
|
||||||
printProgramName();
|
printProgramName();
|
||||||
/* CONTINUA */
|
current_border_type_ = Border::YELLOW_AND_BLUE;
|
||||||
|
Audio::get()->playMusic("loading_data1.ogg", 0);
|
||||||
|
break;
|
||||||
case State::DATA2:
|
case State::DATA2:
|
||||||
|
current_border_type_ = Border::YELLOW_AND_BLUE;
|
||||||
|
Audio::get()->playMusic("loading_data2.ogg", 0);
|
||||||
|
break;
|
||||||
case State::LOADING_MONO:
|
case State::LOADING_MONO:
|
||||||
current_border_type_ = Border::YELLOW_AND_BLUE;
|
current_border_type_ = Border::YELLOW_AND_BLUE;
|
||||||
// Reproducir sonido de carga monocromática
|
Audio::get()->playMusic("loading_screen_data.ogg", 0);
|
||||||
Audio::get()->playMusic("loading_sound2.ogg");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State::LOADING_COLOR:
|
case State::LOADING_COLOR:
|
||||||
current_border_type_ = Border::YELLOW_AND_BLUE;
|
current_border_type_ = Border::YELLOW_AND_BLUE;
|
||||||
// Reproducir sonido de carga en color
|
Audio::get()->playMusic("loading_screen_color.ogg", 0);
|
||||||
Audio::get()->playMusic("loading_sound3.ogg");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State::COMPLETE:
|
case State::COMPLETE:
|
||||||
current_border_type_ = Border::WHITE;
|
current_border_type_ = Border::BLACK;
|
||||||
// Transicionar a la pantalla de título
|
// Transicionar a la pantalla de título
|
||||||
SceneManager::current = SceneManager::Scene::TITLE;
|
SceneManager::current = SceneManager::Scene::TITLE;
|
||||||
SceneManager::options = SceneManager::Options::TITLE_WITH_LOADING_SCREEN;
|
SceneManager::options = SceneManager::Options::TITLE_WITH_LOADING_SCREEN;
|
||||||
@@ -409,6 +411,9 @@ void LoadingScreen::renderBorder() {
|
|||||||
case Border::WHITE:
|
case Border::WHITE:
|
||||||
renderColoredBorder(PaletteColor::WHITE);
|
renderColoredBorder(PaletteColor::WHITE);
|
||||||
break;
|
break;
|
||||||
|
case Border::BLACK:
|
||||||
|
renderColoredBorder(PaletteColor::BLACK);
|
||||||
|
break;
|
||||||
case Border::RED:
|
case Border::RED:
|
||||||
renderColoredBorder(PaletteColor::RED);
|
renderColoredBorder(PaletteColor::RED);
|
||||||
break;
|
break;
|
||||||
@@ -455,7 +460,7 @@ void LoadingScreen::updateSilent(float delta_time) {
|
|||||||
|
|
||||||
// Oscilación compuesta para simular picos de ruido
|
// Oscilación compuesta para simular picos de ruido
|
||||||
const float modulation = std::sin(noise_.total_time * 4.2F) * std::sin(noise_.total_time * 1.7F + 0.5F);
|
const float modulation = std::sin(noise_.total_time * 4.2F) * std::sin(noise_.total_time * 1.7F + 0.5F);
|
||||||
noise_.value = std::fabs(modulation); // rango [0.0, 1.0]
|
noise_.value = std::fabs(modulation); // rango [0.0, 1.0]
|
||||||
|
|
||||||
// Detecta cruce de umbral solo si venía de abajo
|
// Detecta cruce de umbral solo si venía de abajo
|
||||||
if (noise_.value > NOISE_THRESHOLD && !noise_.crossed) {
|
if (noise_.value > NOISE_THRESHOLD && !noise_.crossed) {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ class LoadingScreen {
|
|||||||
YELLOW_AND_BLUE,
|
YELLOW_AND_BLUE,
|
||||||
RED_AND_CYAN,
|
RED_AND_CYAN,
|
||||||
WHITE,
|
WHITE,
|
||||||
|
BLACK,
|
||||||
RED,
|
RED,
|
||||||
CYAN
|
CYAN
|
||||||
};
|
};
|
||||||
@@ -59,12 +60,12 @@ class LoadingScreen {
|
|||||||
// --- Constantes de tiempo (en segundos) ---
|
// --- Constantes de tiempo (en segundos) ---
|
||||||
static constexpr float SILENT1_DURATION = 2.0F; // Pausa inicial
|
static constexpr float SILENT1_DURATION = 2.0F; // Pausa inicial
|
||||||
static constexpr float HEADER1_DURATION = 4.0F; // Cabecera
|
static constexpr float HEADER1_DURATION = 4.0F; // Cabecera
|
||||||
static constexpr float DATA1_DURATION = 0.1F; // Datos
|
static constexpr float DATA1_DURATION = 0.2F; // Datos
|
||||||
static constexpr float SILENT2_DURATION = 3.0F; // Segunda pausa
|
static constexpr float SILENT2_DURATION = 2.0F; // Segunda pausa
|
||||||
static constexpr float HEADER2_DURATION = 2.0F; // Cabecera pantalla
|
static constexpr float HEADER2_DURATION = 3.0F; // Cabecera pantalla
|
||||||
static constexpr float LOADING_MONO_DURATION = 16.0F; // Duración total de la carga monocromática
|
static constexpr float LOADING_MONO_DURATION = 16.0F; // Duración total de la carga monocromática
|
||||||
static constexpr float LOADING_COLOR_DURATION = 4.0F; // Duración total de la carga en color
|
static constexpr float LOADING_COLOR_DURATION = 4.0F; // Duración total de la carga en color
|
||||||
static constexpr float DATA2_DURATION = 2.0F; // Datos
|
static constexpr float DATA2_DURATION = 5.0F; // Datos
|
||||||
|
|
||||||
// --- Constantes de geometría ---
|
// --- Constantes de geometría ---
|
||||||
static constexpr int MONO_TOTAL_LINES = 192; // Total de líneas en carga monocromática
|
static constexpr int MONO_TOTAL_LINES = 192; // Total de líneas en carga monocromática
|
||||||
|
|||||||
Reference in New Issue
Block a user