Compare commits
2 Commits
ea7628259a
...
ca6edcccc0
| Author | SHA1 | Date | |
|---|---|---|---|
| ca6edcccc0 | |||
| a388005968 |
@@ -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
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"[GAME_TEXT] 6": "Temps!",
|
"[GAME_TEXT] 6": "Temps!",
|
||||||
"[GAME_TEXT] 7": "Endavant!",
|
"[GAME_TEXT] 7": "Endavant!",
|
||||||
"[GAME_TEXT] 8": "1.000.000 de punts!",
|
"[GAME_TEXT] 8": "1.000.000 de punts!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Gracies!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Millors puntuacions",
|
"[HIGHSCORE_TABLE] CAPTION": "Millors puntuacions",
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"[GAME_TEXT] 6": "Stop!",
|
"[GAME_TEXT] 6": "Stop!",
|
||||||
"[GAME_TEXT] 7": "Get Ready!",
|
"[GAME_TEXT] 7": "Get Ready!",
|
||||||
"[GAME_TEXT] 8": "1,000,000 points!",
|
"[GAME_TEXT] 8": "1,000,000 points!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Thank you!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Best scores",
|
"[HIGHSCORE_TABLE] CAPTION": "Best scores",
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"[GAME_TEXT] 6": "Tiempo!",
|
"[GAME_TEXT] 6": "Tiempo!",
|
||||||
"[GAME_TEXT] 7": "Adelante!",
|
"[GAME_TEXT] 7": "Adelante!",
|
||||||
"[GAME_TEXT] 8": "1.000.000 de puntos!",
|
"[GAME_TEXT] 8": "1.000.000 de puntos!",
|
||||||
|
"[GAME_TEXT] THANK_YOU": "Gracias!",
|
||||||
|
|
||||||
"[HIGHSCORE_TABLE] CAPTION": "Mejores puntuaciones",
|
"[HIGHSCORE_TABLE] CAPTION": "Mejores puntuaciones",
|
||||||
|
|
||||||
|
|||||||
@@ -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.)
|
||||||
|
|||||||
@@ -598,7 +598,8 @@ void Resource::createTextTextures() {
|
|||||||
{"game_text_powerup", Lang::getText("[GAME_TEXT] 4")},
|
{"game_text_powerup", Lang::getText("[GAME_TEXT] 4")},
|
||||||
{"game_text_one_hit", Lang::getText("[GAME_TEXT] 5")},
|
{"game_text_one_hit", Lang::getText("[GAME_TEXT] 5")},
|
||||||
{"game_text_stop", Lang::getText("[GAME_TEXT] 6")},
|
{"game_text_stop", Lang::getText("[GAME_TEXT] 6")},
|
||||||
{"game_text_1000000_points", Lang::getText("[GAME_TEXT] 8")}};
|
{"game_text_1000000_points", Lang::getText("[GAME_TEXT] 8")},
|
||||||
|
{"game_text_thank_you", Lang::getText("[GAME_TEXT] THANK_YOU")}};
|
||||||
|
|
||||||
auto text = getText("04b_25");
|
auto text = getText("04b_25");
|
||||||
for (const auto &s : strings) {
|
for (const auto &s : strings) {
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ void Game::setResources() {
|
|||||||
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_one_hit"));
|
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_one_hit"));
|
||||||
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_stop"));
|
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_stop"));
|
||||||
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_100000_points"));
|
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_100000_points"));
|
||||||
|
game_text_textures_.emplace_back(Resource::get()->getTexture("game_text_thank_you"));
|
||||||
|
|
||||||
// Texturas - Items
|
// Texturas - Items
|
||||||
item_textures_.clear();
|
item_textures_.clear();
|
||||||
@@ -1474,9 +1475,12 @@ 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
|
||||||
|
const auto X = player->getPosX() + (player->getWidth() - game_text_textures_.at(7)->getWidth()) / 2;
|
||||||
|
createItemText(X, game_text_textures_.at(7));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disminuye el contador de continuación si se presiona cualquier botón de disparo.
|
// Disminuye el contador de continuación si se presiona cualquier botón de disparo.
|
||||||
|
|||||||
Reference in New Issue
Block a user