Sync projectiles animations (#51)
This commit is contained in:
@@ -20,6 +20,7 @@ pub struct AnimationFlags {
|
||||
pub jumping: bool,
|
||||
pub just_jumped: bool,
|
||||
pub shooting: bool,
|
||||
pub restart_shooting: bool,
|
||||
pub hit: bool,
|
||||
}
|
||||
|
||||
@@ -110,12 +111,15 @@ fn update_animation(
|
||||
.animation(anims.run_shoot.unwrap())
|
||||
.unwrap()
|
||||
.is_finished()
|
||||
|| flags.restart_shooting
|
||||
{
|
||||
controller
|
||||
.player
|
||||
.animation_mut(anims.run_shoot.unwrap())
|
||||
.unwrap()
|
||||
.replay();
|
||||
|
||||
flags.restart_shooting = false;
|
||||
}
|
||||
} else if flags.shooting && anims.shoot.is_some() {
|
||||
if !controller.is_playing(anims.shoot.unwrap()) {
|
||||
@@ -130,12 +134,15 @@ fn update_animation(
|
||||
.animation(anims.shoot.unwrap())
|
||||
.unwrap()
|
||||
.is_finished()
|
||||
|| flags.restart_shooting
|
||||
{
|
||||
controller
|
||||
.player
|
||||
.animation_mut(anims.shoot.unwrap())
|
||||
.unwrap()
|
||||
.replay();
|
||||
|
||||
flags.restart_shooting = false;
|
||||
}
|
||||
} else if flags.hit {
|
||||
if !controller.is_playing(anims.hit) {
|
||||
|
||||
Reference in New Issue
Block a user