Noves animacions per a deixar de disparar
This commit is contained in:
@@ -1710,32 +1710,24 @@ void Game::handleNormalPlayerInput(const std::shared_ptr<Player> &player)
|
||||
handleFireInputs(player, autofire, controllerIndex); // Verifica y maneja todas las posibles entradas de disparo.
|
||||
}
|
||||
|
||||
// Procesa las entradas de disparo del jugador, permitiendo disparos automáticos
|
||||
// si está habilitado.
|
||||
void Game::handleFireInputs(const std::shared_ptr<Player> &player,
|
||||
bool autofire, int controllerIndex)
|
||||
// Procesa las entradas de disparo del jugador, permitiendo disparos automáticos si está habilitado.
|
||||
void Game::handleFireInputs(const std::shared_ptr<Player> &player, bool autofire, int controllerIndex)
|
||||
{
|
||||
if (input_->checkInput(InputType::FIRE_CENTER, autofire,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index))
|
||||
if (input_->checkInput(InputType::FIRE_CENTER, autofire, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index))
|
||||
{
|
||||
handleFireInput(player, BulletType::UP);
|
||||
#ifdef RECORDING
|
||||
demo_.keys.fire = 1;
|
||||
#endif
|
||||
}
|
||||
else if (input_->checkInput(InputType::FIRE_LEFT, autofire,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index))
|
||||
else if (input_->checkInput(InputType::FIRE_LEFT, autofire, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index))
|
||||
{
|
||||
handleFireInput(player, BulletType::LEFT);
|
||||
#ifdef RECORDING
|
||||
demo_.keys.fire_left = 1;
|
||||
#endif
|
||||
}
|
||||
else if (input_->checkInput(InputType::FIRE_RIGHT, autofire,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index))
|
||||
else if (input_->checkInput(InputType::FIRE_RIGHT, autofire, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index))
|
||||
{
|
||||
handleFireInput(player, BulletType::RIGHT);
|
||||
#ifdef RECORDING
|
||||
@@ -1744,29 +1736,19 @@ void Game::handleFireInputs(const std::shared_ptr<Player> &player,
|
||||
}
|
||||
}
|
||||
|
||||
// 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::handlePlayerContinue(const std::shared_ptr<Player> &player)
|
||||
{
|
||||
const auto controllerIndex = player->getController();
|
||||
if (input_->checkInput(InputType::START, INPUT_DO_NOT_ALLOW_REPEAT,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index))
|
||||
if (input_->checkInput(InputType::START, INPUT_DO_NOT_ALLOW_REPEAT, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index))
|
||||
{
|
||||
player->setStatusPlaying(PlayerStatus::PLAYING);
|
||||
}
|
||||
|
||||
// Disminuye el contador de continuación si se presiona cualquier botón de
|
||||
// disparo.
|
||||
if (input_->checkInput(InputType::FIRE_LEFT, INPUT_DO_NOT_ALLOW_REPEAT,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index) ||
|
||||
input_->checkInput(InputType::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index) ||
|
||||
input_->checkInput(InputType::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT,
|
||||
options.controller[controllerIndex].device_type,
|
||||
options.controller[controllerIndex].index))
|
||||
// Disminuye el contador de continuación si se presiona cualquier botón de disparo.
|
||||
if (input_->checkInput(InputType::FIRE_LEFT, INPUT_DO_NOT_ALLOW_REPEAT, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index) ||
|
||||
input_->checkInput(InputType::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index) ||
|
||||
input_->checkInput(InputType::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT, options.controller[controllerIndex].device_type, options.controller[controllerIndex].index))
|
||||
{
|
||||
player->decContinueCounter();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user