corregit bug en el modo invulnerable si caies de molt alt, es quedava marcat com mort i al llevar la invulnerabilitat, moria
This commit is contained in:
@@ -473,10 +473,15 @@ void Game::handleDebugMouseDrag(float delta_time) {
|
||||
float game_x = render_x - dst_rect.x;
|
||||
float game_y = render_y - dst_rect.y;
|
||||
|
||||
// Verificar si el botón izquierdo está presionado
|
||||
// Verificar si los botones están presionados
|
||||
bool left_button_pressed = (buttons & SDL_BUTTON_LMASK) != 0;
|
||||
bool right_button_pressed = (buttons & SDL_BUTTON_RMASK) != 0;
|
||||
|
||||
if (left_button_pressed) {
|
||||
// Botón derecho: teleport instantáneo a la posición del cursor
|
||||
if (right_button_pressed && !debug_dragging_player_) {
|
||||
player_->setDebugPosition(game_x, game_y);
|
||||
player_->finalizeDebugTeleport();
|
||||
} else if (left_button_pressed) {
|
||||
// Obtener posición actual del jugador
|
||||
SDL_FRect player_rect = player_->getRect();
|
||||
float player_x = player_rect.x;
|
||||
@@ -501,6 +506,8 @@ void Game::handleDebugMouseDrag(float delta_time) {
|
||||
}
|
||||
|
||||
debug_dragging_player_ = true;
|
||||
Debug::get()->add(std::string("X : " + std::to_string(static_cast<int>(player_rect.x))));
|
||||
Debug::get()->add(std::string("Y : " + std::to_string(static_cast<int>(player_rect.y))));
|
||||
} else if (debug_dragging_player_) {
|
||||
// Botón soltado después de arrastrar: finalizar teleport
|
||||
player_->finalizeDebugTeleport();
|
||||
|
||||
Reference in New Issue
Block a user