diff --git a/sim_scenes/featured/jupiter_moon_protects_earth.py b/sim_scenes/featured/jupiter_moon_protects_earth.py index e981361306463b3d4dbf110eb1dd47423430f670..284d4479dc36922e40f07f2d188949963ab6c6aa 100644 --- a/sim_scenes/featured/jupiter_moon_protects_earth.py +++ b/sim_scenes/featured/jupiter_moon_protects_earth.py @@ -191,6 +191,10 @@ class JupiterMoonProtectsEarthSim(UniverseSimScenes): if collided: # 如果碰撞了,则该石头重复再利用,这样才保证有无限个石头可用 pos, vel = self.random_pos_vel() + comet.planet.on_reset() + comet.planet.trails.clear() + if hasattr(comet.planet, "trail_last_pos"): + delattr(comet.planet, "trail_last_pos") comet.init_position = pos comet.init_velocity = vel comet.set_visible(True) @@ -290,7 +294,7 @@ if __name__ == '__main__': # 使用 ursina 查看的运行效果 # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- - ursina_run(sim.bodies, SECONDS_PER_MONTH / 6, + ursina_run(sim.bodies, SECONDS_PER_MONTH / 2, position=(AU, AU * 5, -AU * 5), cosmic_bg='', show_grid=False,