diff --git a/data/config/param_320x240.txt b/data/config/param_320x240.txt index 5bbe1d0..7a0769c 100644 --- a/data/config/param_320x240.txt +++ b/data/config/param_320x240.txt @@ -36,11 +36,11 @@ scoreboard.text_color2 FFFFFF # Color secundario del texto del marca scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos) ## --- TITLE --- -title.press_start_position 170 # Posición Y del texto "Press Start" +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.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.bg_color 808080 # Color de fondo en la sección titulo +title.bg_color 41526F # Color de fondo en la sección titulo ## --- BACKGROUND --- background.attenuate_color FFFFFF00 # Color de atenuación del fondo (RGBA hexadecimal) @@ -76,7 +76,7 @@ service_menu.bg_color 003000F5 # Color de fondo del menú de servicio ( service_menu.drop_shadow false # ¿El menú de servicio tiene sombra? ## --- INTRO --- -intro.bg_color 00FFFF # Color de fondo de la intro +intro.bg_color 4664BD # Color de fondo de 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.text_distance_from_bottom 48 # Posicion del texto @@ -85,5 +85,5 @@ intro.text_distance_from_bottom 48 # Posicion del texto debug.color 00FFFF # Color para elementos de depuración ## --- RESOURCE --- -resource.color CDD1CD # Color de recurso 1 -resource.color 17E97A # Color de recurso 2 \ No newline at end of file +resource.color FFFFFF # Color de recurso 1 +resource.color FFFFFF # Color de recurso 2 \ No newline at end of file diff --git a/data/config/param_320x256.txt b/data/config/param_320x256.txt index b424293..6f2ba8e 100644 --- a/data/config/param_320x256.txt +++ b/data/config/param_320x256.txt @@ -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.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.bg_color 39393F # Color de fondo en la sección titulo +title.bg_color 41526F # Color de fondo en la sección titulo ## --- BACKGROUND --- 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? ## --- INTRO --- -intro.bg_color 39393F # Color de fondo de la intro +intro.bg_color 4664BD # Color de fondo de 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.text_distance_from_bottom 48 # Posicion del texto @@ -85,5 +85,5 @@ intro.text_distance_from_bottom 48 # Posicion del texto debug.color 00FFFF # Color para elementos de depuración ## --- RESOURCE --- -resource.color CDD1CD # Color de recurso 1 -resource.color 17E97A # Color de recurso 2 \ No newline at end of file +resource.color FFFFFF # Color de recurso 1 +resource.color FFFFFF # Color de recurso 2 \ No newline at end of file diff --git a/data/gfx/title/title_bg_tile.png b/data/gfx/title/title_bg_tile.png index 701763e..fedb3cf 100644 Binary files a/data/gfx/title/title_bg_tile.png and b/data/gfx/title/title_bg_tile.png differ diff --git a/data/gfx/title/title_bg_tile_v2.png b/data/gfx/title/title_bg_tile_v2.png deleted file mode 100644 index 8673a2a..0000000 Binary files a/data/gfx/title/title_bg_tile_v2.png and /dev/null differ diff --git a/data/sound/game_start.wav b/data/sound/game_start.wav deleted file mode 100644 index 4413164..0000000 Binary files a/data/sound/game_start.wav and /dev/null differ diff --git a/source/director.cpp b/source/director.cpp index 5ec053e..0e320d8 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -301,7 +301,6 @@ void Director::setFileList() Asset::get()->add(prefix + "/data/sound/continue_clock.wav", AssetType::SOUND); Asset::get()->add(prefix + "/data/sound/debian_drop.wav", AssetType::SOUND); Asset::get()->add(prefix + "/data/sound/debian_pickup.wav", AssetType::SOUND); - Asset::get()->add(prefix + "/data/sound/game_start.wav", AssetType::SOUND); Asset::get()->add(prefix + "/data/sound/hi_score_achieved.wav", AssetType::SOUND); Asset::get()->add(prefix + "/data/sound/item_drop.wav", AssetType::SOUND); Asset::get()->add(prefix + "/data/sound/item_pickup.wav", AssetType::SOUND); @@ -402,7 +401,6 @@ void Director::setFileList() // Texturas - Titulo Asset::get()->add(prefix + "/data/gfx/title/title_bg_tile.png", AssetType::BITMAP); - Asset::get()->add(prefix + "/data/gfx/title/title_bg_tile_v2.png", AssetType::BITMAP); Asset::get()->add(prefix + "/data/gfx/title/title_coffee.png", AssetType::BITMAP); Asset::get()->add(prefix + "/data/gfx/title/title_crisis.png", AssetType::BITMAP); Asset::get()->add(prefix + "/data/gfx/title/title_arcade_edition.png", AssetType::BITMAP); diff --git a/source/manage_hiscore_table.cpp b/source/manage_hiscore_table.cpp index c2b00a0..c8a9c24 100644 --- a/source/manage_hiscore_table.cpp +++ b/source/manage_hiscore_table.cpp @@ -21,7 +21,7 @@ void ManageHiScoreTable::clear() table_.push_back(HiScoreEntry("PEPE", 5000)); table_.push_back(HiScoreEntry("ROSIT", 1000)); table_.push_back(HiScoreEntry("SAM", 500)); - table_.push_back(HiScoreEntry("PACMA", 200)); + table_.push_back(HiScoreEntry("PACMQ", 200)); table_.push_back(HiScoreEntry("PELEC", 100)); sort(); diff --git a/source/sections/intro.cpp b/source/sections/intro.cpp index 37a0e80..8fed741 100644 --- a/source/sections/intro.cpp +++ b/source/sections/intro.cpp @@ -24,7 +24,9 @@ #include "writer.h" // Para Writer #include "input.h" +#ifdef DEBUG #include // Para std::hex, std::setw, std::setfill +#endif // Constructor Intro::Intro() @@ -85,6 +87,7 @@ void Intro::checkEvents() case SDLK_C: if (color.b > 0) --color.b; + break; case SDLK_F: if (color.r < 255) @@ -163,7 +166,6 @@ void Intro::updateScenes() texts_.at(2)->setEnabled(false); scene_++; } - break; } @@ -185,7 +187,6 @@ void Intro::updateScenes() texts_.at(3)->setEnabled(false); scene_++; } - break; } @@ -206,7 +207,6 @@ void Intro::updateScenes() texts_.at(4)->setEnabled(false); scene_++; } - break; } @@ -234,7 +234,6 @@ void Intro::updateScenes() texts_.at(6)->setEnabled(false); scene_++; } - break; } @@ -256,7 +255,6 @@ void Intro::updateScenes() texts_.at(7)->setEnabled(false); scene_++; } - break; } @@ -283,7 +281,6 @@ void Intro::updateScenes() state_ = IntroState::POST; state_start_time_ = SDL_GetTicks(); } - break; } @@ -436,7 +433,7 @@ void Intro::initSprites() card_sprites_.at(2)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, 40, easeOutQuint, 0); card_sprites_.at(3)->addPath(param.game.height, Y_DEST, PathType::VERTICAL, X_DEST, 300, easeInOutExpo, 0); card_sprites_.at(4)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, 70, easeOutElastic, 0); - card_sprites_.at(5)->addPath(param.game.width, X_DEST, PathType::HORIZONTAL, Y_DEST, 250, easeOutQuad, 450); + card_sprites_.at(5)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, 250, easeOutQuad, 450); card_sprites_.at(5)->addPath(X_DEST, -CARD_WIDTH, PathType::HORIZONTAL, Y_DEST, 80, easeInElastic, 0); // Constantes @@ -486,9 +483,9 @@ void Intro::initSprites() shadow_sprites_.at(0)->addPath(param.game.height + 10, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 100, easeInOutExpo, 0); shadow_sprites_.at(1)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 100, easeOutBounce, 0); shadow_sprites_.at(2)->addPath(-SHADOW_SPRITE_WIDTH, S_X_DEST, PathType::HORIZONTAL, S_Y_DEST, 40, easeOutQuint, 0); - shadow_sprites_.at(3)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 400, easeInOutExpo, 0); + shadow_sprites_.at(3)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 300, easeInOutExpo, 0); shadow_sprites_.at(4)->addPath(param.game.height, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 70, easeOutElastic, 0); - shadow_sprites_.at(5)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, 250, easeOutQuad, 450); + shadow_sprites_.at(5)->addPath(param.game.width, S_X_DEST, PathType::HORIZONTAL, S_Y_DEST, 250, easeOutQuad, 450); shadow_sprites_.at(5)->addPath(S_X_DEST, param.game.width, PathType::HORIZONTAL, S_Y_DEST, 80, easeInElastic, 0); } @@ -596,18 +593,14 @@ void Intro::updatePostState() switch (post_state_) { case IntroPostState::STOP_BG: - // EVENTO: Detiene el fondo después de 2 segundos + // EVENTO: Detiene el fondo después de 1 segundo if (ELAPSED_TIME >= 1000) { tiled_bg_->stopGracefully(); - if (bg_color_.isEqualTo(param.title.bg_color)) + if (!bg_color_.isEqualTo(param.title.bg_color)) { - // Ya hemos llegado al color objetivo - } - else - { - bg_color_ = bg_color_.approachTo(param.title.bg_color, 2); + bg_color_ = bg_color_.approachTo(param.title.bg_color, 1); } tiled_bg_->setColor(bg_color_); diff --git a/source/sections/title.cpp b/source/sections/title.cpp index 6ff4621..4d32934 100644 --- a/source/sections/title.cpp +++ b/source/sections/title.cpp @@ -27,6 +27,10 @@ #include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK #include "ui/service_menu.h" +#ifdef DEBUG +#include // Para std::hex, std::setw, std::setfill +#endif + // Constructor Title::Title() : text_(Resource::get()->getText("smb2_grad")), @@ -107,6 +111,72 @@ void Title::checkEvents() SDL_Event event; while (SDL_PollEvent(&event)) { +#ifdef DEBUG + if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 1) + { + static Color color = param.title.bg_color; + switch (event.key.key) + { + case SDLK_A: + if (color.r < 255) + ++color.r; + break; + + case SDLK_Z: + if (color.r > 0) + --color.r; + break; + + case SDLK_S: + if (color.g < 255) + ++color.g; + break; + + case SDLK_X: + if (color.g > 0) + --color.g; + break; + + case SDLK_D: + if (color.b < 255) + ++color.b; + break; + + case SDLK_C: + if (color.b > 0) + --color.b; + break; + + 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; + + default: + break; + } + counter_ = 0; + tiled_bg_->setColor(color); + 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 if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 0) { switch (event.key.key) @@ -477,19 +547,19 @@ void Title::initPlayers() // Actualza los jugadores void Title::updatePlayers() { - for (auto &player : players_) - { - player->update(); - } + for (auto &player : players_) + { + player->update(); + } } // Renderiza los jugadores void Title::renderPlayers() { - for (auto const &player : players_) - { - player->render(); - } + for (auto const &player : players_) + { + player->render(); + } } // Obtiene un jugador a partir de su "id" diff --git a/source/tiled_bg.cpp b/source/tiled_bg.cpp index bc9bd11..2d97d3b 100644 --- a/source/tiled_bg.cpp +++ b/source/tiled_bg.cpp @@ -54,7 +54,7 @@ TiledBG::~TiledBG() void TiledBG::fillTexture() { // Crea los objetos para pintar en la textura de fondo - auto tile = std::make_unique(Resource::get()->getTexture("title_bg_tile_v2.png"), (SDL_FRect){0, 0, TILE_WIDTH_, TILE_HEIGHT_}); + auto tile = std::make_unique(Resource::get()->getTexture("title_bg_tile.png"), (SDL_FRect){0, 0, TILE_WIDTH_, TILE_HEIGHT_}); // Prepara para dibujar sobre la textura auto temp = SDL_GetRenderTarget(renderer_);