提交 ceac7abc 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 8c4abb8a
......@@ -58,8 +58,6 @@ if __name__ == '__main__':
def on_ready():
camera_look_at(jupiter, rotation_z=0)
UrsinaConfig.trail_length = 150
UrsinaConfig.trail_type = "line"
def on_timer_changed(time_data: TimeData):
......@@ -68,8 +66,6 @@ if __name__ == '__main__':
rock.planet.rotation += rock.rotation
# 循环判断每个抛出物与木星是否相碰撞
if two_bodies_colliding(rock, jupiter):
# 如果岩石与木星相碰撞了,则静止不动(岩石停止并忽略引力)
rock.stop_and_ignore_gravity()
# 岩石爆炸
rock.explode(jupiter)
......
......@@ -92,6 +92,8 @@ class UrsinaSimulator(Simulator):
def body_explode(target=None):
# from panda3d.core import GeomUtils
if body.planet.enabled:
# 如果爆炸,则静止不动(停止并忽略引力)
body.stop_and_ignore_gravity()
body.planet.enabled = False
explosion_file = find_file("images/explosion")
explosion_file = os.path.join(explosion_file, "explosion")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册