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

Python超人-宇宙模拟器

上级 fd760ec1
images/1.png

334.7 KB | W: | H:

images/1.png

329.3 KB | W: | H:

images/1.png
images/1.png
images/1.png
images/1.png
  • 2-up
  • Swipe
  • Onion skin
images/2.png

428.0 KB | W: | H:

images/2.png

369.9 KB | W: | H:

images/2.png
images/2.png
images/2.png
images/2.png
  • 2-up
  • Swipe
  • Onion skin
images/3.png

345.0 KB | W: | H:

images/3.png

355.7 KB | W: | H:

images/3.png
images/3.png
images/3.png
images/3.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -20,7 +20,7 @@ if __name__ == '__main__':
# 以下展示的效果为太阳系真实的距离
# 由于宇宙空间尺度非常大,如果按照实际的天体大小,则无法看到天体,因此需要对天体的尺寸进行放大
sun = Sun(name="太阳", size_scale=0.8e2) # 太阳放大 80 倍,距离保持不变
sun.init_velocity = [0, 0, 2] # 太阳带着其他行星一起跑
# sun.init_velocity = [0, 0, 2] # 太阳带着其他行星一起跑
bodies = [
sun,
Mercury(name="水星", size_scale=4e3), # 水星放大 4000 倍,距离保持不变
......
......@@ -223,9 +223,9 @@ class ControlHandler(EventHandler):
self.ui.on_off_switch.value = self.ui.pause_button_text
self.on_off_switch_changed()
elif key == '+' or key == "= up":
self.slider_increase(self.ui.slider_run_speed_factor)
self.slider_increase(self.ui.slider_run_speed_factor, 0.1)
elif key == '-' or key == "- up":
self.slider_decrease(self.ui.slider_run_speed_factor)
self.slider_decrease(self.ui.slider_run_speed_factor, 0.1)
elif key == 'n':
import math
# min=0.01, max=20
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册