mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-30 01:02:51 +00:00
fix jittery whimsical star during pause
This commit is contained in:
parent
b181f9293f
commit
c9f11d6c9f
|
@ -38,6 +38,13 @@ impl WhimsicalStar {
|
|||
active_star: 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_prev(&mut self) {
|
||||
for iter in 0..=2 {
|
||||
self.star[iter].prev_x = self.star[iter].x;
|
||||
self.star[iter].prev_y = self.star[iter].y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GameEntity<(&Player, &mut BulletManager)> for WhimsicalStar {
|
||||
|
@ -76,9 +83,6 @@ impl GameEntity<(&Player, &mut BulletManager)> for WhimsicalStar {
|
|||
self.star[iter].vel_x = self.star[iter].vel_x.clamp(-0xA00, 0xA00);
|
||||
self.star[iter].vel_y = self.star[iter].vel_y.clamp(-0xA00, 0xA00);
|
||||
|
||||
self.star[iter].prev_x = self.star[iter].x;
|
||||
self.star[iter].prev_y = self.star[iter].y;
|
||||
|
||||
self.star[iter].x += self.star[iter].vel_x;
|
||||
self.star[iter].y += self.star[iter].vel_y;
|
||||
|
||||
|
|
|
@ -1715,6 +1715,8 @@ impl Scene for GameScene {
|
|||
}
|
||||
}
|
||||
|
||||
self.whimsical_star.set_prev();
|
||||
|
||||
self.inventory_dim += 0.1
|
||||
* if state.textscript_vm.mode == ScriptMode::Inventory {
|
||||
state.frame_time as f32
|
||||
|
|
Loading…
Reference in a new issue