"""一个简单的演示八大行星公转的动画,采用arcade街机游戏模块制作,安装Arcade请用pip install arcade --user。
A simple animation to simulate the rotation of eight planets is made by using Arcade module. To install Arcade, use PIP install arcade--user.
"""
__author__ = "lixingqiu"
__date__ = "2019/3/8"
import time
import math
import arcade
import random
SCREEN_WIDTH = 1350
SCREEN_HEIGHT = 780
SCREEN_TITLE = "eight planet 八大行星"
class Planet(arcade.Sprite):
def __init__(self,image,a,b,angle,speed):
"""image:造型图片,a:Long axis长半轴,b:semi-minor axis短半轴,angle:初始角度"""
super().__init__(image)
self.center_x = SCREEN_WIDTH / 2
self.center_y = SCREEN_HEIGHT / 2
self.direction = angle # 自定义di