commit amb mil mini coses, colorets, fitxers que sobraven, comentaris, codi que sobrava, etc...
This commit is contained in:
@@ -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)
|
scoreboard.skip_countdown_value 8 # Valor para saltar la cuenta atrás (segundos)
|
||||||
|
|
||||||
## --- TITLE ---
|
## --- 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.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 808080 # Color de fondo en la sección titulo
|
title.bg_color 41526F # 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 003000F5 # 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 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.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
|
||||||
@@ -85,5 +85,5 @@ intro.text_distance_from_bottom 48 # Posicion del texto
|
|||||||
debug.color 00FFFF # Color para elementos de depuración
|
debug.color 00FFFF # Color para elementos de depuración
|
||||||
|
|
||||||
## --- RESOURCE ---
|
## --- RESOURCE ---
|
||||||
resource.color CDD1CD # Color de recurso 1
|
resource.color FFFFFF # Color de recurso 1
|
||||||
resource.color 17E97A # Color de recurso 2
|
resource.color FFFFFF # Color de recurso 2
|
||||||
@@ -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 39393F # Color de fondo en la sección titulo
|
title.bg_color 41526F # 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 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.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
|
||||||
@@ -85,5 +85,5 @@ intro.text_distance_from_bottom 48 # Posicion del texto
|
|||||||
debug.color 00FFFF # Color para elementos de depuración
|
debug.color 00FFFF # Color para elementos de depuración
|
||||||
|
|
||||||
## --- RESOURCE ---
|
## --- RESOURCE ---
|
||||||
resource.color CDD1CD # Color de recurso 1
|
resource.color FFFFFF # Color de recurso 1
|
||||||
resource.color 17E97A # Color de recurso 2
|
resource.color FFFFFF # Color de recurso 2
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
@@ -301,7 +301,6 @@ void Director::setFileList()
|
|||||||
Asset::get()->add(prefix + "/data/sound/continue_clock.wav", AssetType::SOUND);
|
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_drop.wav", AssetType::SOUND);
|
||||||
Asset::get()->add(prefix + "/data/sound/debian_pickup.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/hi_score_achieved.wav", AssetType::SOUND);
|
||||||
Asset::get()->add(prefix + "/data/sound/item_drop.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);
|
Asset::get()->add(prefix + "/data/sound/item_pickup.wav", AssetType::SOUND);
|
||||||
@@ -402,7 +401,6 @@ void Director::setFileList()
|
|||||||
|
|
||||||
// Texturas - Titulo
|
// 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.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_coffee.png", AssetType::BITMAP);
|
||||||
Asset::get()->add(prefix + "/data/gfx/title/title_crisis.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);
|
Asset::get()->add(prefix + "/data/gfx/title/title_arcade_edition.png", AssetType::BITMAP);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ void ManageHiScoreTable::clear()
|
|||||||
table_.push_back(HiScoreEntry("PEPE", 5000));
|
table_.push_back(HiScoreEntry("PEPE", 5000));
|
||||||
table_.push_back(HiScoreEntry("ROSIT", 1000));
|
table_.push_back(HiScoreEntry("ROSIT", 1000));
|
||||||
table_.push_back(HiScoreEntry("SAM", 500));
|
table_.push_back(HiScoreEntry("SAM", 500));
|
||||||
table_.push_back(HiScoreEntry("PACMA", 200));
|
table_.push_back(HiScoreEntry("PACMQ", 200));
|
||||||
table_.push_back(HiScoreEntry("PELEC", 100));
|
table_.push_back(HiScoreEntry("PELEC", 100));
|
||||||
|
|
||||||
sort();
|
sort();
|
||||||
|
|||||||
@@ -24,7 +24,9 @@
|
|||||||
#include "writer.h" // Para Writer
|
#include "writer.h" // Para Writer
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
#include <iomanip> // Para std::hex, std::setw, std::setfill
|
#include <iomanip> // Para std::hex, std::setw, std::setfill
|
||||||
|
#endif
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Intro::Intro()
|
Intro::Intro()
|
||||||
@@ -85,6 +87,7 @@ void Intro::checkEvents()
|
|||||||
case SDLK_C:
|
case SDLK_C:
|
||||||
if (color.b > 0)
|
if (color.b > 0)
|
||||||
--color.b;
|
--color.b;
|
||||||
|
break;
|
||||||
|
|
||||||
case SDLK_F:
|
case SDLK_F:
|
||||||
if (color.r < 255)
|
if (color.r < 255)
|
||||||
@@ -163,7 +166,6 @@ void Intro::updateScenes()
|
|||||||
texts_.at(2)->setEnabled(false);
|
texts_.at(2)->setEnabled(false);
|
||||||
scene_++;
|
scene_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +187,6 @@ void Intro::updateScenes()
|
|||||||
texts_.at(3)->setEnabled(false);
|
texts_.at(3)->setEnabled(false);
|
||||||
scene_++;
|
scene_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +207,6 @@ void Intro::updateScenes()
|
|||||||
texts_.at(4)->setEnabled(false);
|
texts_.at(4)->setEnabled(false);
|
||||||
scene_++;
|
scene_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +234,6 @@ void Intro::updateScenes()
|
|||||||
texts_.at(6)->setEnabled(false);
|
texts_.at(6)->setEnabled(false);
|
||||||
scene_++;
|
scene_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +255,6 @@ void Intro::updateScenes()
|
|||||||
texts_.at(7)->setEnabled(false);
|
texts_.at(7)->setEnabled(false);
|
||||||
scene_++;
|
scene_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +281,6 @@ void Intro::updateScenes()
|
|||||||
state_ = IntroState::POST;
|
state_ = IntroState::POST;
|
||||||
state_start_time_ = SDL_GetTicks();
|
state_start_time_ = SDL_GetTicks();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
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(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(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(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);
|
card_sprites_.at(5)->addPath(X_DEST, -CARD_WIDTH, PathType::HORIZONTAL, Y_DEST, 80, easeInElastic, 0);
|
||||||
|
|
||||||
// Constantes
|
// 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(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(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(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(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);
|
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_)
|
switch (post_state_)
|
||||||
{
|
{
|
||||||
case IntroPostState::STOP_BG:
|
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)
|
if (ELAPSED_TIME >= 1000)
|
||||||
{
|
{
|
||||||
tiled_bg_->stopGracefully();
|
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
|
bg_color_ = bg_color_.approachTo(param.title.bg_color, 1);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bg_color_ = bg_color_.approachTo(param.title.bg_color, 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tiled_bg_->setColor(bg_color_);
|
tiled_bg_->setColor(bg_color_);
|
||||||
|
|||||||
@@ -27,6 +27,10 @@
|
|||||||
#include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK
|
#include "utils.h" // Para Color, Zone, fade_color, no_color, BLOCK
|
||||||
#include "ui/service_menu.h"
|
#include "ui/service_menu.h"
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
#include <iomanip> // Para std::hex, std::setw, std::setfill
|
||||||
|
#endif
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Title::Title()
|
Title::Title()
|
||||||
: text_(Resource::get()->getText("smb2_grad")),
|
: text_(Resource::get()->getText("smb2_grad")),
|
||||||
@@ -107,6 +111,72 @@ void Title::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)
|
||||||
|
{
|
||||||
|
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)
|
if (event.type == SDL_EVENT_KEY_DOWN && event.key.repeat == 0)
|
||||||
{
|
{
|
||||||
switch (event.key.key)
|
switch (event.key.key)
|
||||||
@@ -477,19 +547,19 @@ void Title::initPlayers()
|
|||||||
// Actualza los jugadores
|
// Actualza los jugadores
|
||||||
void Title::updatePlayers()
|
void Title::updatePlayers()
|
||||||
{
|
{
|
||||||
for (auto &player : players_)
|
for (auto &player : players_)
|
||||||
{
|
{
|
||||||
player->update();
|
player->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renderiza los jugadores
|
// Renderiza los jugadores
|
||||||
void Title::renderPlayers()
|
void Title::renderPlayers()
|
||||||
{
|
{
|
||||||
for (auto const &player : players_)
|
for (auto const &player : players_)
|
||||||
{
|
{
|
||||||
player->render();
|
player->render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtiene un jugador a partir de su "id"
|
// Obtiene un jugador a partir de su "id"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ TiledBG::~TiledBG()
|
|||||||
void TiledBG::fillTexture()
|
void TiledBG::fillTexture()
|
||||||
{
|
{
|
||||||
// Crea los objetos para pintar en la textura de fondo
|
// Crea los objetos para pintar en la textura de fondo
|
||||||
auto tile = std::make_unique<Sprite>(Resource::get()->getTexture("title_bg_tile_v2.png"), (SDL_FRect){0, 0, TILE_WIDTH_, TILE_HEIGHT_});
|
auto tile = std::make_unique<Sprite>(Resource::get()->getTexture("title_bg_tile.png"), (SDL_FRect){0, 0, TILE_WIDTH_, TILE_HEIGHT_});
|
||||||
|
|
||||||
// Prepara para dibujar sobre la textura
|
// Prepara para dibujar sobre la textura
|
||||||
auto temp = SDL_GetRenderTarget(renderer_);
|
auto temp = SDL_GetRenderTarget(renderer_);
|
||||||
|
|||||||
Reference in New Issue
Block a user