import turtle
import random
t=turtle
#缩写
t.register_shape("1.gif")
t.register_shape("2.gif")
#定义形状
玩家=t.Turtle()
玩家.shape("2.gif")
玩家.penup()
#设立玩家形状
def left():
玩家.setheading(180)
玩家.forward(10)
def right():
玩家.setheading(0)
玩家.forward(10)
#设立玩家移动
球1=t.Turtle()
球1.shape("1.gif")
球1.penup()
球1.hideturtle()
球1.goto(random.randint(-500,500),400)
球2=t.Turtle()
球2.shape("1.gif")
球2.penup()
球2.hideturtle()
球2.goto(random.randint(-500,500),400)
球3=t.Turtle()
球3.shape("1.gif")
球3.penup()
球3.hideturtle()
球3.goto(random.randint(-500,500),400)
球4=t.Turtle()
球4.shape("1.gif")
球4.penup()
球4.hideturtle()
球4.goto(random.randint(-500,500),400)
球5=t.Turtle()
球5.shape("1.gif")
球5.penup()
球5.hideturtle()
球5.goto(random.randint(-500,500),400)
球6=t.Turtle()
球6.shape("1.gif")
球6.penup()
球6.hideturtle()
球6.goto(random.randint(-500,500),400)
球7=t.Turtle()
球7.shape("1.gif")
球7.penup()
球7.hideturtle()
球7.goto(random.randint(-500,500),400)
球8=t.Turtle()
球8.shape("1.gif")
球8.penup()
球8.hideturtle()