漂亮的斜抛粒子散射线_物理模拟初中物理

"""
    漂亮的斜抛粒子散射线_物理模拟初中物理
"""

import time
import math
from turtle import *

def main():
    """主要执行函数"""

    colors = ['red','orange','yellow','green','cyan',
              'blue','purple','brown','pink','magenta']
    screen = Screen()
    screen.delay(0)
    screen.bgcolor('black')
    screen.title("投射彩线条动画演示by李兴球")
    
    i = 0
    for angle in range(10,90,3):
        print(angle)
        Particle(colors[i],angle,(-200,100),70)
        i = i + 1
        i = i % len(colors)

    screen.mainloop()


class Particle(Turtle):
    """继承自Turtle的粒子类"""
    def __init__(self,color,angle,pos,speed):
        """
           color:颜色
           angle:角度
           pos:位置
           speed:速度
        """
        

You must log in to read the rest of this article. Please log in or register as a user.