els items començen a parpadejar quan ja estan quets a terra
This commit is contained in:
@@ -43,7 +43,7 @@ Director::Director(int argc, std::span<char*> argv) {
|
||||
Section::name = Section::Name::GAME;
|
||||
Section::options = Section::Options::GAME_PLAY_1P;
|
||||
#elif _DEBUG
|
||||
Section::name = Section::Name::LOGO;
|
||||
Section::name = Section::Name::GAME;
|
||||
Section::options = Section::Options::GAME_PLAY_1P;
|
||||
#else // NORMAL GAME
|
||||
Section::name = Section::Name::LOGO;
|
||||
|
||||
@@ -44,6 +44,7 @@ Item::Item(ItemType type, float x, float y, SDL_FRect& play_area, const std::sha
|
||||
collider_.r = width_ / 2;
|
||||
sprite_->startRotate();
|
||||
sprite_->setRotateAmount(rotate_speed_);
|
||||
sprite_->setCurrentAnimation("no-blink");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -142,6 +143,7 @@ void Item::move(float deltaTime) {
|
||||
if (std::abs(vel_y_) < BOUNCE_VEL_THRESHOLD) {
|
||||
// Si la velocidad vertical es baja, detiene el objeto
|
||||
vel_y_ = vel_x_ = accel_x_ = accel_y_ = 0;
|
||||
sprite_->setCurrentAnimation("blink");
|
||||
} else {
|
||||
// Si la velocidad vertical es alta, el objeto rebota y pierde velocidad
|
||||
vel_y_ *= ITEM_BOUNCE_DAMPING;
|
||||
|
||||
Reference in New Issue
Block a user