treballant en la visió original de la intro
This commit is contained in:
@@ -3,25 +3,24 @@
|
||||
#include <SDL3/SDL.h> // Para SDL_GetTicks, SDL_SetRenderDrawColor, SDL_FRect, SDL_RenderFillRect, SDL_GetRenderTarget, SDL_RenderClear, SDL_RenderRect, SDL_SetRenderTarget, SDL_BLENDMODE_BLEND, SDL_PixelFormat, SDL_PollEvent, SDL_RenderTexture, SDL_TextureAccess, SDL_Event, Uint64
|
||||
|
||||
#include <array> // Para array
|
||||
#include <functional> // Para function
|
||||
#include <string> // Para basic_string, string
|
||||
#include <utility> // Para move
|
||||
|
||||
#include "audio.hpp" // Para Audio
|
||||
#include "card_sprite.hpp" // Para CardSprite
|
||||
#include "color.hpp" // Para Color
|
||||
#include "global_events.hpp" // Para handle
|
||||
#include "global_inputs.hpp" // Para check
|
||||
#include "input.hpp" // Para Input
|
||||
#include "lang.hpp" // Para getText
|
||||
#include "param.hpp" // Para Param, param, ParamGame, ParamIntro, ParamTitle
|
||||
#include "path_sprite.hpp" // Para PathSprite, PathType
|
||||
#include "resource.hpp" // Para Resource
|
||||
#include "screen.hpp" // Para Screen
|
||||
#include "section.hpp" // Para Name, name, Options, options
|
||||
#include "text.hpp" // Para Text
|
||||
#include "texture.hpp" // Para Texture
|
||||
#include "tiled_bg.hpp" // Para TiledBG, TiledBGMode
|
||||
#include "utils.hpp" // Para Zone, easeInOutExpo, easeInElastic, easeOutBounce, easeOutElastic, easeOutQuad, easeOutQuint
|
||||
#include "utils.hpp" // Para easeOutBounce
|
||||
#include "writer.hpp" // Para Writer
|
||||
|
||||
// Constructor
|
||||
@@ -31,7 +30,7 @@ Intro::Intro()
|
||||
Section::name = Section::Name::INTRO;
|
||||
Section::options = Section::Options::NONE;
|
||||
|
||||
// Inicializa las imagens
|
||||
// Inicializa las tarjetas
|
||||
initSprites();
|
||||
|
||||
// Inicializa los textos
|
||||
@@ -83,100 +82,99 @@ void Intro::updateScenes() {
|
||||
}
|
||||
|
||||
void Intro::updateScene0() {
|
||||
// Primera imagen - UPV
|
||||
enableCardAndShadow(0);
|
||||
// Primera imagen - UPV: activa la tarjeta
|
||||
card_sprites_.at(0)->enable();
|
||||
|
||||
// Primer texto de la primera imagen
|
||||
if (card_sprites_.at(0)->hasFinished() && !texts_.at(0)->hasFinished()) {
|
||||
// Primer texto cuando aterriza
|
||||
if (card_sprites_.at(0)->hasLanded() && !texts_.at(0)->hasFinished()) {
|
||||
texts_.at(0)->setEnabled(true);
|
||||
}
|
||||
|
||||
// Segundo texto de la primera imagen
|
||||
// Segundo texto
|
||||
if (texts_.at(0)->hasFinished() && !texts_.at(1)->hasFinished()) {
|
||||
switchText(0, 1);
|
||||
}
|
||||
|
||||
// Tercer texto de la primera imagen
|
||||
// Tercer texto
|
||||
if (texts_.at(1)->hasFinished() && !texts_.at(2)->hasFinished()) {
|
||||
switchText(1, 2);
|
||||
}
|
||||
|
||||
// Fin de la primera escena
|
||||
// Fin de la primera escena: la tarjeta sale despedida
|
||||
if (texts_.at(2)->hasFinished()) {
|
||||
texts_.at(2)->setEnabled(false);
|
||||
scene_++;
|
||||
startCardExitAndAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
void Intro::updateScene1() {
|
||||
// Segunda imagen - Máquina
|
||||
enableCardAndShadow(1);
|
||||
card_sprites_.at(1)->enable();
|
||||
|
||||
// Primer texto de la segunda imagen
|
||||
if (card_sprites_.at(1)->hasFinished() && !texts_.at(3)->hasFinished()) {
|
||||
// Texto cuando aterriza
|
||||
if (card_sprites_.at(1)->hasLanded() && !texts_.at(3)->hasFinished()) {
|
||||
texts_.at(3)->setEnabled(true);
|
||||
}
|
||||
|
||||
// Fin de la segunda escena
|
||||
if (texts_.at(3)->hasFinished()) {
|
||||
texts_.at(3)->setEnabled(false);
|
||||
scene_++;
|
||||
startCardExitAndAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
void Intro::updateScene2() {
|
||||
// Tercera imagen junto con primer texto - GRITO
|
||||
// Tercera imagen - GRITO: tarjeta y texto a la vez
|
||||
card_sprites_.at(2)->enable();
|
||||
if (!texts_.at(4)->hasFinished()) {
|
||||
enableCardAndShadow(2);
|
||||
texts_.at(4)->setEnabled(true);
|
||||
}
|
||||
|
||||
// Fin de la tercera escena
|
||||
if (card_sprites_.at(2)->hasFinished() && texts_.at(4)->hasFinished()) {
|
||||
if (card_sprites_.at(2)->hasLanded() && texts_.at(4)->hasFinished()) {
|
||||
texts_.at(4)->setEnabled(false);
|
||||
scene_++;
|
||||
startCardExitAndAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
void Intro::updateScene3() {
|
||||
// Cuarta imagen junto con primer texto - Reflexión
|
||||
enableCardAndShadow(3);
|
||||
// Cuarta imagen - Reflexión
|
||||
card_sprites_.at(3)->enable();
|
||||
|
||||
if (!texts_.at(5)->hasFinished()) {
|
||||
texts_.at(5)->setEnabled(true);
|
||||
}
|
||||
|
||||
// Segundo texto de la cuarta imagen
|
||||
// Segundo texto
|
||||
if (texts_.at(5)->hasFinished() && !texts_.at(6)->hasFinished()) {
|
||||
switchText(5, 6);
|
||||
}
|
||||
|
||||
// Fin de la cuarta escena
|
||||
if (card_sprites_.at(3)->hasFinished() && texts_.at(6)->hasFinished()) {
|
||||
if (card_sprites_.at(3)->hasLanded() && texts_.at(6)->hasFinished()) {
|
||||
texts_.at(6)->setEnabled(false);
|
||||
scene_++;
|
||||
startCardExitAndAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
void Intro::updateScene4() {
|
||||
// Quinta imagen - Patada
|
||||
enableCardAndShadow(4);
|
||||
card_sprites_.at(4)->enable();
|
||||
|
||||
// Primer texto de la quinta imagen
|
||||
if (!texts_.at(7)->hasFinished()) {
|
||||
texts_.at(7)->setEnabled(true);
|
||||
}
|
||||
|
||||
// Fin de la quinta escena
|
||||
if (card_sprites_.at(4)->hasFinished() && texts_.at(7)->hasFinished()) {
|
||||
if (card_sprites_.at(4)->hasLanded() && texts_.at(7)->hasFinished()) {
|
||||
texts_.at(7)->setEnabled(false);
|
||||
scene_++;
|
||||
startCardExitAndAdvance();
|
||||
}
|
||||
}
|
||||
|
||||
void Intro::updateScene5() {
|
||||
// Sexta imagen junto con texto - Globos de café
|
||||
enableCardAndShadow(5);
|
||||
// Sexta imagen - Globos de café
|
||||
card_sprites_.at(5)->enable();
|
||||
|
||||
if (!texts_.at(8)->hasFinished()) {
|
||||
texts_.at(8)->setEnabled(true);
|
||||
@@ -187,17 +185,18 @@ void Intro::updateScene5() {
|
||||
texts_.at(8)->setEnabled(false);
|
||||
}
|
||||
|
||||
// Acaba la ultima imagen
|
||||
if (card_sprites_.at(5)->hasFinished() && texts_.at(8)->hasFinished()) {
|
||||
// Última tarjeta: sale "como si se la llevara el viento" y transición a POST
|
||||
if (card_sprites_.at(5)->hasLanded() && texts_.at(8)->hasFinished()) {
|
||||
card_sprites_.at(5)->startExit();
|
||||
state_ = State::POST;
|
||||
state_start_time_ = SDL_GetTicks() / 1000.0F;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper methods to reduce code duplication
|
||||
void Intro::enableCardAndShadow(int index) {
|
||||
card_sprites_.at(index)->enable();
|
||||
shadow_sprites_.at(index)->enable();
|
||||
// Inicia la salida de la tarjeta actual y avanza a la siguiente escena
|
||||
void Intro::startCardExitAndAdvance() {
|
||||
card_sprites_.at(scene_)->startExit();
|
||||
scene_++;
|
||||
}
|
||||
|
||||
void Intro::switchText(int from_index, int to_index) {
|
||||
@@ -221,6 +220,7 @@ void Intro::update(float delta_time) {
|
||||
break;
|
||||
|
||||
case State::POST:
|
||||
updateSprites(delta_time); // La última tarjeta puede estar saliendo durante POST
|
||||
updatePostState();
|
||||
break;
|
||||
}
|
||||
@@ -243,6 +243,7 @@ void Intro::render() {
|
||||
break;
|
||||
}
|
||||
case State::POST:
|
||||
renderSprites(); // La última tarjeta puede estar saliendo
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -272,7 +273,7 @@ void Intro::run() {
|
||||
}
|
||||
}
|
||||
|
||||
// Inicializa las imagens
|
||||
// Inicializa las tarjetas
|
||||
void Intro::initSprites() {
|
||||
// Listado de imagenes a usar
|
||||
const std::array<std::string, 6> TEXTURE_LIST = {
|
||||
@@ -291,24 +292,21 @@ void Intro::initSprites() {
|
||||
const float CARD_WIDTH = texture->getWidth() + (BORDER * 2);
|
||||
const float CARD_HEIGHT = texture->getHeight() + (BORDER * 2);
|
||||
|
||||
// Crea las texturas para las tarjetas
|
||||
// Crea las texturas para las tarjetas (imagen con marco)
|
||||
std::vector<std::shared_ptr<Texture>> card_textures;
|
||||
|
||||
for (int i = 0; i < TOTAL_SPRITES; ++i) {
|
||||
// Crea la textura
|
||||
auto card_texture = std::make_unique<Texture>(Screen::get()->getRenderer());
|
||||
card_texture->createBlank(CARD_WIDTH, CARD_HEIGHT, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET);
|
||||
card_texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Apuntamos el renderizador a la textura
|
||||
auto* temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
card_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||
|
||||
// Limpia la textura
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 0);
|
||||
SDL_RenderClear(Screen::get()->getRenderer());
|
||||
|
||||
// Pone color en el marco de la textura
|
||||
// Marco de la tarjeta
|
||||
auto color = param.intro.card_color;
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), color.r, color.g, color.b, color.a);
|
||||
SDL_FRect rect1 = {.x = 1, .y = 0, .w = CARD_WIDTH - 2, .h = CARD_HEIGHT};
|
||||
@@ -316,85 +314,87 @@ void Intro::initSprites() {
|
||||
SDL_RenderRect(Screen::get()->getRenderer(), &rect1);
|
||||
SDL_RenderRect(Screen::get()->getRenderer(), &rect2);
|
||||
|
||||
// Copia la textura con la imagen dentro del marco
|
||||
// Imagen dentro del marco
|
||||
SDL_FRect dest = {.x = BORDER, .y = BORDER, .w = CARD_WIDTH - (BORDER * 2), .h = CARD_HEIGHT - (BORDER * 2)};
|
||||
SDL_RenderTexture(Screen::get()->getRenderer(), Resource::get()->getTexture(TEXTURE_LIST.at(i))->getSDLTexture(), nullptr, &dest);
|
||||
|
||||
// Deja el renderizador como estaba y añade la textura a la lista
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), temp);
|
||||
card_textures.push_back(std::move(card_texture));
|
||||
}
|
||||
|
||||
// Inicializa los sprites para las tarjetas
|
||||
for (int i = 0; i < TOTAL_SPRITES; ++i) {
|
||||
auto sprite = std::make_unique<PathSprite>(card_textures.at(i));
|
||||
sprite->setWidth(CARD_WIDTH);
|
||||
sprite->setHeight(CARD_HEIGHT);
|
||||
sprite->setSpriteClip(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||
card_sprites_.push_back(std::move(sprite));
|
||||
}
|
||||
|
||||
const float X_DEST = param.game.game_area.center_x - (CARD_WIDTH / 2);
|
||||
const float Y_DEST = param.game.game_area.first_quarter_y - (CARD_HEIGHT / 4);
|
||||
|
||||
card_sprites_.at(0)->addPath(-CARD_WIDTH - CARD_OFFSET_MARGIN, X_DEST, PathType::HORIZONTAL, Y_DEST, CARD_ANIM_DURATION_NORMAL, easeInOutExpo, 0.0F);
|
||||
card_sprites_.at(1)->addPath(param.game.width, X_DEST, PathType::HORIZONTAL, Y_DEST, CARD_ANIM_DURATION_NORMAL, easeOutBounce, 0.0F);
|
||||
card_sprites_.at(2)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, CARD_ANIM_DURATION_FAST, easeOutQuint, 0.0F);
|
||||
card_sprites_.at(3)->addPath(param.game.height, Y_DEST, PathType::VERTICAL, X_DEST, CARD_ANIM_DURATION_VERY_SLOW, easeInOutExpo, 0.0F);
|
||||
card_sprites_.at(4)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, CARD_ANIM_DURATION_MEDIUM, easeOutElastic, 0.0F);
|
||||
card_sprites_.at(5)->addPath(-CARD_HEIGHT, Y_DEST, PathType::VERTICAL, X_DEST, CARD_ANIM_DURATION_SLOW, easeOutQuad, CARD_ANIM_DELAY_LONG_S);
|
||||
card_sprites_.at(5)->addPath(X_DEST, -CARD_WIDTH, PathType::HORIZONTAL, Y_DEST, CARD_ANIM_DURATION_SHORT, easeInElastic, 0.0F);
|
||||
|
||||
// Constantes
|
||||
const float DESP = SHADOW_OFFSET;
|
||||
const float SHADOW_SPRITE_WIDTH = CARD_WIDTH;
|
||||
const float SHADOW_SPRITE_HEIGHT = CARD_HEIGHT;
|
||||
|
||||
// Crea la textura para las sombras de las tarjetas
|
||||
// Crea la textura de sombra (compartida entre todas las tarjetas)
|
||||
auto shadow_texture = std::make_shared<Texture>(Screen::get()->getRenderer());
|
||||
shadow_texture->createBlank(SHADOW_SPRITE_WIDTH, SHADOW_SPRITE_HEIGHT, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET);
|
||||
shadow_texture->createBlank(CARD_WIDTH, CARD_HEIGHT, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET);
|
||||
shadow_texture->setBlendMode(SDL_BLENDMODE_BLEND);
|
||||
|
||||
// Apuntamos el renderizador a la textura
|
||||
auto* temp = SDL_GetRenderTarget(Screen::get()->getRenderer());
|
||||
shadow_texture->setAsRenderTarget(Screen::get()->getRenderer());
|
||||
|
||||
// Limpia la textura
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 0);
|
||||
SDL_RenderClear(Screen::get()->getRenderer());
|
||||
|
||||
// Dibuja la sombra sobre la textura
|
||||
auto shadow_color = param.intro.shadow_color;
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), shadow_color.r, shadow_color.g, shadow_color.b, Color::MAX_ALPHA_VALUE);
|
||||
SDL_FRect rect1 = {.x = 1, .y = 0, .w = SHADOW_SPRITE_WIDTH - 2, .h = SHADOW_SPRITE_HEIGHT};
|
||||
SDL_FRect rect2 = {.x = 0, .y = 1, .w = SHADOW_SPRITE_WIDTH, .h = SHADOW_SPRITE_HEIGHT - 2};
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &rect1);
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &rect2);
|
||||
SDL_FRect shadow_rect1 = {.x = 1, .y = 0, .w = CARD_WIDTH - 2, .h = CARD_HEIGHT};
|
||||
SDL_FRect shadow_rect2 = {.x = 0, .y = 1, .w = CARD_WIDTH, .h = CARD_HEIGHT - 2};
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &shadow_rect1);
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &shadow_rect2);
|
||||
|
||||
// Deja el renderizador como estaba y añade la textura a la lista
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), temp);
|
||||
shadow_texture->setAlpha(shadow_color.a);
|
||||
|
||||
// Inicializa los sprites para la sombras usando la texturas con la sombra
|
||||
// Posición de aterrizaje (centro de la zona de juego)
|
||||
const float X_DEST = param.game.game_area.center_x - (CARD_WIDTH / 2);
|
||||
const float Y_DEST = param.game.game_area.first_quarter_y - (CARD_HEIGHT / 4);
|
||||
|
||||
// Ángulos de entrada por tarjeta (variedad visual)
|
||||
const double ENTRY_ANGLES[] = {CARD_ANGLE_0, CARD_ANGLE_1, CARD_ANGLE_2, CARD_ANGLE_3, CARD_ANGLE_4, CARD_ANGLE_5};
|
||||
|
||||
// Direcciones de salida: cada tarjeta sale en una dirección diferente
|
||||
// {vx, vy, ax, ay, rotate_amount}
|
||||
struct ExitConfig {
|
||||
float vx;
|
||||
float vy;
|
||||
float ax;
|
||||
float ay;
|
||||
double rotate_amount;
|
||||
};
|
||||
|
||||
const ExitConfig EXIT_CONFIGS[] = {
|
||||
{ CARD_EXIT_SPEED, -CARD_EXIT_SPEED * 0.15F, CARD_EXIT_ACCEL, 0.0F, CARD_EXIT_ROTATION}, // 0: Derecha + leve arriba
|
||||
{-CARD_EXIT_SPEED, CARD_EXIT_SPEED * 0.25F, -CARD_EXIT_ACCEL, CARD_EXIT_ACCEL * 0.2F, -CARD_EXIT_ROTATION * 1.1}, // 1: Izquierda + abajo
|
||||
{ CARD_EXIT_SPEED, -CARD_EXIT_SPEED * 0.4F, CARD_EXIT_ACCEL, -CARD_EXIT_ACCEL * 0.3F, CARD_EXIT_ROTATION * 0.8}, // 2: Derecha + arriba
|
||||
{-CARD_EXIT_SPEED, -CARD_EXIT_SPEED * 0.2F, -CARD_EXIT_ACCEL, 0.0F, -CARD_EXIT_ROTATION}, // 3: Izquierda + leve arriba
|
||||
{ CARD_EXIT_SPEED * 0.2F, CARD_EXIT_SPEED, 0.0F, CARD_EXIT_ACCEL, CARD_EXIT_ROTATION * 1.2}, // 4: Abajo + leve derecha
|
||||
{-CARD_EXIT_SPEED * 0.6F, -CARD_EXIT_SPEED * 0.1F, -CARD_EXIT_ACCEL * 0.5F, 0.0F, -CARD_EXIT_ROTATION * 0.7}, // 5: Izquierda suave (viento)
|
||||
};
|
||||
|
||||
// Inicializa los CardSprites
|
||||
for (int i = 0; i < TOTAL_SPRITES; ++i) {
|
||||
auto shadow_color = param.intro.shadow_color;
|
||||
auto sprite = std::make_unique<PathSprite>(shadow_texture);
|
||||
sprite->setWidth(SHADOW_SPRITE_WIDTH);
|
||||
sprite->setHeight(SHADOW_SPRITE_HEIGHT);
|
||||
sprite->setSpriteClip(0, 0, SHADOW_SPRITE_WIDTH, SHADOW_SPRITE_HEIGHT);
|
||||
sprite->getTexture()->setAlpha(shadow_color.a);
|
||||
shadow_sprites_.push_back(std::move(sprite));
|
||||
auto card = std::make_unique<CardSprite>(card_textures.at(i));
|
||||
card->setWidth(CARD_WIDTH);
|
||||
card->setHeight(CARD_HEIGHT);
|
||||
card->setSpriteClip(0, 0, CARD_WIDTH, CARD_HEIGHT);
|
||||
|
||||
// Posición de aterrizaje
|
||||
card->setLandingPosition(X_DEST, Y_DEST);
|
||||
|
||||
// Parámetros de entrada: zoom, ángulo, duración, easing
|
||||
card->setEntryParams(CARD_START_ZOOM, ENTRY_ANGLES[i], CARD_ENTRY_DURATION_S, easeOutBounce);
|
||||
|
||||
// Parámetros de salida
|
||||
const auto& exit = EXIT_CONFIGS[i];
|
||||
card->setExitParams(exit.vx, exit.vy, exit.ax, exit.ay, exit.rotate_amount);
|
||||
|
||||
// Sombra
|
||||
card->setShadowTexture(shadow_texture);
|
||||
card->setShadowOffset(SHADOW_OFFSET, SHADOW_OFFSET);
|
||||
|
||||
// Límites de pantalla
|
||||
card->setScreenBounds(param.game.width, param.game.height);
|
||||
|
||||
card_sprites_.push_back(std::move(card));
|
||||
}
|
||||
|
||||
const float S_X_DEST = X_DEST + DESP;
|
||||
const float S_Y_DEST = Y_DEST + DESP;
|
||||
|
||||
shadow_sprites_.at(0)->addPath(param.game.height + CARD_OFFSET_MARGIN, S_Y_DEST, PathType::VERTICAL, S_X_DEST, CARD_ANIM_DURATION_NORMAL, easeInOutExpo, 0.0F);
|
||||
shadow_sprites_.at(1)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, CARD_ANIM_DURATION_NORMAL, easeOutBounce, 0.0F);
|
||||
shadow_sprites_.at(2)->addPath(-SHADOW_SPRITE_WIDTH, S_X_DEST, PathType::HORIZONTAL, S_Y_DEST, CARD_ANIM_DURATION_FAST, easeOutQuint, 0.0F);
|
||||
shadow_sprites_.at(3)->addPath(-SHADOW_SPRITE_HEIGHT, S_Y_DEST, PathType::VERTICAL, S_X_DEST, CARD_ANIM_DURATION_VERY_SLOW, easeInOutExpo, 0.0F);
|
||||
shadow_sprites_.at(4)->addPath(param.game.height, S_Y_DEST, PathType::VERTICAL, S_X_DEST, CARD_ANIM_DURATION_MEDIUM, easeOutElastic, 0.0F);
|
||||
shadow_sprites_.at(5)->addPath(param.game.width, S_X_DEST, PathType::HORIZONTAL, S_Y_DEST, CARD_ANIM_DURATION_SLOW, easeOutQuad, CARD_ANIM_DELAY_LONG_S);
|
||||
shadow_sprites_.at(5)->addPath(S_X_DEST, param.game.width, PathType::HORIZONTAL, S_Y_DEST, CARD_ANIM_DURATION_SHORT, easeInElastic, 0.0F);
|
||||
}
|
||||
|
||||
// Inicializa los textos
|
||||
@@ -456,10 +456,6 @@ void Intro::updateSprites(float delta_time) {
|
||||
for (auto& sprite : card_sprites_) {
|
||||
sprite->update(delta_time);
|
||||
}
|
||||
|
||||
for (auto& sprite : shadow_sprites_) {
|
||||
sprite->update(delta_time);
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza los textos
|
||||
@@ -469,10 +465,11 @@ void Intro::updateTexts(float delta_time) {
|
||||
}
|
||||
}
|
||||
|
||||
// Dibuja los sprites
|
||||
// Dibuja los sprites (todas las tarjetas activas, para que convivan la saliente y la entrante)
|
||||
void Intro::renderSprites() {
|
||||
shadow_sprites_.at(scene_)->render();
|
||||
card_sprites_.at(scene_)->render();
|
||||
for (auto& card : card_sprites_) {
|
||||
card->render();
|
||||
}
|
||||
}
|
||||
|
||||
// Dibuja los textos
|
||||
@@ -525,4 +522,4 @@ void Intro::renderTextRect() {
|
||||
static SDL_FRect rect_ = {.x = 0.0F, .y = param.game.height - param.intro.text_distance_from_bottom - HEIGHT, .w = param.game.width, .h = HEIGHT * 3};
|
||||
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), param.intro.shadow_color.r, param.intro.shadow_color.g, param.intro.shadow_color.b, param.intro.shadow_color.a);
|
||||
SDL_RenderFillRect(Screen::get()->getRenderer(), &rect_);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user