els items començen a parpadejar quan ja estan quets a terra
This commit is contained in:
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -2,8 +2,15 @@ frame_width=20
|
|||||||
frame_height=20
|
frame_height=20
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=blink
|
||||||
speed=0.1333
|
speed=0.2
|
||||||
loop=0
|
loop=0
|
||||||
frames=0,0,1
|
frames=0,1
|
||||||
|
[/animation]
|
||||||
|
|
||||||
|
[animation]
|
||||||
|
name=no-blink
|
||||||
|
speed=0
|
||||||
|
loop=-1
|
||||||
|
frames=1
|
||||||
[/animation]
|
[/animation]
|
||||||
@@ -43,7 +43,7 @@ Director::Director(int argc, std::span<char*> argv) {
|
|||||||
Section::name = Section::Name::GAME;
|
Section::name = Section::Name::GAME;
|
||||||
Section::options = Section::Options::GAME_PLAY_1P;
|
Section::options = Section::Options::GAME_PLAY_1P;
|
||||||
#elif _DEBUG
|
#elif _DEBUG
|
||||||
Section::name = Section::Name::LOGO;
|
Section::name = Section::Name::GAME;
|
||||||
Section::options = Section::Options::GAME_PLAY_1P;
|
Section::options = Section::Options::GAME_PLAY_1P;
|
||||||
#else // NORMAL GAME
|
#else // NORMAL GAME
|
||||||
Section::name = Section::Name::LOGO;
|
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;
|
collider_.r = width_ / 2;
|
||||||
sprite_->startRotate();
|
sprite_->startRotate();
|
||||||
sprite_->setRotateAmount(rotate_speed_);
|
sprite_->setRotateAmount(rotate_speed_);
|
||||||
|
sprite_->setCurrentAnimation("no-blink");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,6 +143,7 @@ void Item::move(float deltaTime) {
|
|||||||
if (std::abs(vel_y_) < BOUNCE_VEL_THRESHOLD) {
|
if (std::abs(vel_y_) < BOUNCE_VEL_THRESHOLD) {
|
||||||
// Si la velocidad vertical es baja, detiene el objeto
|
// Si la velocidad vertical es baja, detiene el objeto
|
||||||
vel_y_ = vel_x_ = accel_x_ = accel_y_ = 0;
|
vel_y_ = vel_x_ = accel_x_ = accel_y_ = 0;
|
||||||
|
sprite_->setCurrentAnimation("blink");
|
||||||
} else {
|
} else {
|
||||||
// Si la velocidad vertical es alta, el objeto rebota y pierde velocidad
|
// Si la velocidad vertical es alta, el objeto rebota y pierde velocidad
|
||||||
vel_y_ *= ITEM_BOUNCE_DAMPING;
|
vel_y_ *= ITEM_BOUNCE_DAMPING;
|
||||||
|
|||||||
Reference in New Issue
Block a user