Tom&Jerry
import turtle
import time
import random
def up():
jerry.setheading(90)
jerry.forward(20)
def down():
jerry.setheading(270)
jerry.forward(20)
def left():
jerry.setheading(180)
jerry.forward(20)
def right():
jerry.setheading(0)
jerry.forward(20)
playground = turtle.Screen()
playground.register_shape('tom.gif')
playground.register_shape('jerry.gif')
playground.onkey(up, 'Up')
playground.onkey(down, 'Down')
playground.onkey(left, 'Left')
Tom&Jerry最先出现在Python成神之路。
共有 0 条评论