拉皮筋发射程序

"""
    拉皮筋发射程序,皮筋是画出来的。
    小球发射后受到‘重力’做抛物线运动。
"""
import turtle

def draghandler(x,y):
    """
       turtle2是画皮筋的
    """
    turtle2.clear()
    turtle2.goto(x0,y0)
    turtle2.down()
    turtle2.goto(x,y)    
    screen.update()
    turtle2.up()
    turtle.goto(x,y)    
    screen.update()
    
def releasehandler(x,y):
    """
       鼠标释放事件
    """
    turtle2.clear()
    turtle.ondrag(None)
    turtle.onrelease(None)
    dx = (x0 - x)/10
    dy = (y0 - y)/10
    

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