From a401d89458bfe6c52b53e02c3b2eb6e5042ba484 Mon Sep 17 00:00:00 2001 From: march3 Date: Fri, 14 Apr 2023 19:21:42 +0800 Subject: [PATCH] =?UTF-8?q?Python=E8=B6=85=E4=BA=BA-=E5=AE=87=E5=AE=99?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- objs/diamond.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 objs/diamond.py diff --git a/objs/diamond.py b/objs/diamond.py new file mode 100644 index 0000000..5c06c11 --- /dev/null +++ b/objs/diamond.py @@ -0,0 +1,44 @@ +# -*- coding:utf-8 -*- +# title :地球 +# description :地球 +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from objs.obj import Obj + + +class Diamond(Obj): + """ + 钻石 + """ + + def __init__(self, name="钻石", mass=5.97237e24, + init_position=[0, 0, 0], + init_velocity=[0, 0, 0], + texture="earth1.jpg", size_scale=1.0, distance_scale=1.0, + ignore_mass=False, + trail_color=None, show_name=False, + parent=None): + params = { + "name": name, + "mass": mass, + "init_position": init_position, + "init_velocity": init_velocity, + "density": 5507.85, + "color": (7, 0, 162), + "texture": texture, + "size_scale": size_scale, + "distance_scale": distance_scale, + "ignore_mass": ignore_mass, + "trail_color": trail_color, + "show_name": show_name, + "parent": parent + } + super().__init__(**params) + + +if __name__ == '__main__': + diamond = Diamond() + print(diamond) -- GitLab