Afegida animacioneta pa quan continues
This commit is contained in:
@@ -113,6 +113,13 @@ loop=-1
|
|||||||
frames=42,42,42,42,42,42,43,44,45,46,46,46,46,46,46,45,45,45,46,46,46,45,45,45,44,43,42,42,42
|
frames=42,42,42,42,42,42,43,44,45,46,46,46,46,46,46,45,45,45,46,46,46,45,45,45,44,43,42,42,42
|
||||||
[/animation]
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=thank_you
|
||||||
|
speed=3
|
||||||
|
loop=-1
|
||||||
|
frames=42,42,43,44,45,46,46,46,45,44
|
||||||
|
[/animation]
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=dizzy
|
name=dizzy
|
||||||
speed=5
|
speed=5
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ void Player::move() {
|
|||||||
case State::WAITING:
|
case State::WAITING:
|
||||||
handleWaitingMovement();
|
handleWaitingMovement();
|
||||||
break;
|
break;
|
||||||
|
case State::THANK_YOU:
|
||||||
|
handleThankYouMovement();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -198,6 +201,13 @@ void Player::handlePlayingMovement() {
|
|||||||
shiftSprite();
|
shiftSprite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::handleThankYouMovement() {
|
||||||
|
// Si termina la animacion, cambia de estado
|
||||||
|
if (player_sprite_->animationIsCompleted()) {
|
||||||
|
setPlayingState(State::RESPAWNING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::handleRollingMovement() {
|
void Player::handleRollingMovement() {
|
||||||
handleRollingBoundaryCollision();
|
handleRollingBoundaryCollision();
|
||||||
handleRollingGroundCollision();
|
handleRollingGroundCollision();
|
||||||
@@ -465,6 +475,9 @@ void Player::setAnimation() {
|
|||||||
player_sprite_->setFlip(flipMode);
|
player_sprite_->setFlip(flipMode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case State::THANK_YOU:
|
||||||
|
player_sprite_->setCurrentAnimation("thank_you");
|
||||||
|
break;
|
||||||
case State::WAITING:
|
case State::WAITING:
|
||||||
case State::GAME_OVER:
|
case State::GAME_OVER:
|
||||||
player_sprite_->setCurrentAnimation("hello");
|
player_sprite_->setCurrentAnimation("hello");
|
||||||
@@ -627,8 +640,11 @@ void Player::setPlayingState(State state) {
|
|||||||
playing_state_ = state;
|
playing_state_ = state;
|
||||||
|
|
||||||
switch (playing_state_) {
|
switch (playing_state_) {
|
||||||
case State::RESPAWNING: {
|
case State::THANK_YOU: {
|
||||||
playSound("voice_thankyou.wav");
|
playSound("voice_thankyou.wav");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case State::RESPAWNING: {
|
||||||
setPlayingState(State::PLAYING);
|
setPlayingState(State::PLAYING);
|
||||||
setInvulnerable(true);
|
setInvulnerable(true);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ class Player {
|
|||||||
CREDITS, // Estado para mostrar los créditos del juego
|
CREDITS, // Estado para mostrar los créditos del juego
|
||||||
TITLE_ANIMATION, // Animacion para el titulo
|
TITLE_ANIMATION, // Animacion para el titulo
|
||||||
TITLE_HIDDEN, // Animacion para el titulo
|
TITLE_HIDDEN, // Animacion para el titulo
|
||||||
RESPAWNING, // Tras continuar y volver al juego
|
THANK_YOU, // Al aceptar continuar
|
||||||
|
RESPAWNING, // Tras continuar y dar las gracias, otorga inmunidad y vuelve al juego
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Config {
|
struct Config {
|
||||||
@@ -280,6 +281,7 @@ class Player {
|
|||||||
void transitionToCooling(); // Cambia el estado actual al de enfriamiento (por ejemplo, tras una ráfaga o sobrecalentamiento)
|
void transitionToCooling(); // Cambia el estado actual al de enfriamiento (por ejemplo, tras una ráfaga o sobrecalentamiento)
|
||||||
void completeCooling(); // Finaliza el proceso de enfriamiento y restablece el estado listo para disparar
|
void completeCooling(); // Finaliza el proceso de enfriamiento y restablece el estado listo para disparar
|
||||||
void handlePlayingMovement(); // Gestiona el movimiento del personaje u objeto durante el estado de juego activo
|
void handlePlayingMovement(); // Gestiona el movimiento del personaje u objeto durante el estado de juego activo
|
||||||
|
void handleThankYouMovement(); // Comprueba si ha acabado la animación
|
||||||
void handleRollingMovement(); // Actualiza la lógica de movimiento de "rodar" (posiblemente tras impacto o acción especial)
|
void handleRollingMovement(); // Actualiza la lógica de movimiento de "rodar" (posiblemente tras impacto o acción especial)
|
||||||
void handleRollingBoundaryCollision(); // Detecta y maneja colisiones del objeto rodante con los límites de la pantalla
|
void handleRollingBoundaryCollision(); // Detecta y maneja colisiones del objeto rodante con los límites de la pantalla
|
||||||
void handleRollingGroundCollision(); // Gestiona la interacción del objeto rodante con el suelo (rebotes, frenado, etc.)
|
void handleRollingGroundCollision(); // Gestiona la interacción del objeto rodante con el suelo (rebotes, frenado, etc.)
|
||||||
|
|||||||
@@ -1475,7 +1475,7 @@ void Game::handleFireInputs(const std::shared_ptr<Player> &player, bool autofire
|
|||||||
// Maneja la continuación del jugador cuando no está jugando, permitiendo que continúe si se pulsa el botón de inicio.
|
// Maneja la continuación del jugador cuando no está jugando, permitiendo que continúe si se pulsa el botón de inicio.
|
||||||
void Game::handlePlayerContinueInput(const std::shared_ptr<Player> &player) {
|
void Game::handlePlayerContinueInput(const std::shared_ptr<Player> &player) {
|
||||||
if (input_->checkAction(Input::Action::START, Input::DO_NOT_ALLOW_REPEAT, player->getUsesKeyboard(), player->getGamepad())) {
|
if (input_->checkAction(Input::Action::START, Input::DO_NOT_ALLOW_REPEAT, player->getUsesKeyboard(), player->getGamepad())) {
|
||||||
player->setPlayingState(Player::State::RESPAWNING);
|
player->setPlayingState(Player::State::THANK_YOU);
|
||||||
player->addCredit();
|
player->addCredit();
|
||||||
sendPlayerToTheFront(player);
|
sendPlayerToTheFront(player);
|
||||||
// Crea letrero de THANK_YOU
|
// Crea letrero de THANK_YOU
|
||||||
|
|||||||
Reference in New Issue
Block a user