diff --git a/src/components/whimsical_star.rs b/src/components/whimsical_star.rs index 8458b81..3b2368e 100644 --- a/src/components/whimsical_star.rs +++ b/src/components/whimsical_star.rs @@ -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; diff --git a/src/scene/game_scene.rs b/src/scene/game_scene.rs index bc0768d..4ce384b 100644 --- a/src/scene/game_scene.rs +++ b/src/scene/game_scene.rs @@ -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