eliminats comentaris i info de debug
This commit is contained in:
@@ -23,10 +23,6 @@ Enemy::Enemy(const Data& enemy)
|
|||||||
sprite_->setPosY(enemy.y);
|
sprite_->setPosY(enemy.y);
|
||||||
sprite_->setVelX(enemy.vx);
|
sprite_->setVelX(enemy.vx);
|
||||||
sprite_->setVelY(enemy.vy);
|
sprite_->setVelY(enemy.vy);
|
||||||
/* [DOC:29/10/2025] w i h ja no fan falta, se pilla del .ANI
|
|
||||||
sprite_->setWidth(enemy.w);
|
|
||||||
sprite_->setHeight(enemy.h);
|
|
||||||
[/DOC] */
|
|
||||||
|
|
||||||
const int FLIP = (should_flip_ && enemy.vx < 0.0F) ? SDL_FLIP_HORIZONTAL : SDL_FLIP_NONE;
|
const int FLIP = (should_flip_ && enemy.vx < 0.0F) ? SDL_FLIP_HORIZONTAL : SDL_FLIP_NONE;
|
||||||
const int MIRROR = should_mirror_ ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE;
|
const int MIRROR = should_mirror_ ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ void Player::transitionToState(State state) {
|
|||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case State::ON_GROUND:
|
case State::ON_GROUND:
|
||||||
std::cout << "ON_GROUND\n";
|
//std::cout << "ON_GROUND\n";
|
||||||
vy_ = 0;
|
vy_ = 0;
|
||||||
handleDeathByFalling();
|
handleDeathByFalling();
|
||||||
jump_sound_ctrl_.reset();
|
jump_sound_ctrl_.reset();
|
||||||
@@ -118,7 +118,7 @@ void Player::transitionToState(State state) {
|
|||||||
current_slope_ = nullptr;
|
current_slope_ = nullptr;
|
||||||
break;
|
break;
|
||||||
case State::ON_SLOPE:
|
case State::ON_SLOPE:
|
||||||
std::cout << "ON_SLOPE\n";
|
//std::cout << "ON_SLOPE\n";
|
||||||
vy_ = 0;
|
vy_ = 0;
|
||||||
handleDeathByFalling();
|
handleDeathByFalling();
|
||||||
jump_sound_ctrl_.reset();
|
jump_sound_ctrl_.reset();
|
||||||
@@ -126,7 +126,7 @@ void Player::transitionToState(State state) {
|
|||||||
updateCurrentSlope();
|
updateCurrentSlope();
|
||||||
break;
|
break;
|
||||||
case State::JUMPING:
|
case State::JUMPING:
|
||||||
std::cout << "JUMPING\n";
|
//std::cout << "JUMPING\n";
|
||||||
// Puede saltar desde ON_GROUND o ON_SLOPE
|
// Puede saltar desde ON_GROUND o ON_SLOPE
|
||||||
if (previous_state_ == State::ON_GROUND || previous_state_ == State::ON_SLOPE) {
|
if (previous_state_ == State::ON_GROUND || previous_state_ == State::ON_SLOPE) {
|
||||||
vy_ = -MAX_VY;
|
vy_ = -MAX_VY;
|
||||||
@@ -137,7 +137,7 @@ void Player::transitionToState(State state) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case State::FALLING:
|
case State::FALLING:
|
||||||
std::cout << "FALLING\n";
|
//std::cout << "FALLING\n";
|
||||||
fall_start_position_ = static_cast<int>(y_);
|
fall_start_position_ = static_cast<int>(y_);
|
||||||
last_grounded_position_ = static_cast<int>(y_);
|
last_grounded_position_ = static_cast<int>(y_);
|
||||||
vy_ = MAX_VY;
|
vy_ = MAX_VY;
|
||||||
@@ -644,14 +644,17 @@ void Player::updateCurrentSlope() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Debug output
|
// Debug output
|
||||||
|
/*
|
||||||
if (current_slope_ != nullptr) {
|
if (current_slope_ != nullptr) {
|
||||||
const char* TYPE = isLeftSlope() ? "Left \\" : "Right /";
|
const char* TYPE = isLeftSlope() ? "Left \\" : "Right /";
|
||||||
std::cout << "[SLOPE] " << TYPE
|
std::cout << "[SLOPE] " << TYPE
|
||||||
<< " from (" << current_slope_->x1 << "," << current_slope_->y1 << ")"
|
<< " from (" << current_slope_->x1 << "," << current_slope_->y1 << ")"
|
||||||
<< " to (" << current_slope_->x2 << "," << current_slope_->y2 << ")\n";
|
<< " to (" << current_slope_->x2 << "," << current_slope_->y2 << ")\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
std::cout << "[SLOPE] nullptr\n";
|
std::cout << "[SLOPE] nullptr\n";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba que el jugador no toque ningun tile de los que matan
|
// Comprueba que el jugador no toque ningun tile de los que matan
|
||||||
|
|||||||
Reference in New Issue
Block a user