def __init__(self,
shape,
color,
x = 0,
y = 0):
turtle.Turtle.__init__(self)
# self.hideturtle()
self.penup()
# Register shape if it is a .gif file
if shape.endswith(".gif"):
try:
turtle.register_shape(shape)
except:
Game.logs.append("Warning: {} file missing from disk.".format(shape))
# Set placeholder shape
shape = "square"
self.shape(shape)
self.color(color)
self.goto(x, y)
#Set click binding
self.onclick(self.click)
# Append to master button list
Game.buttons.append(self)
评论列表
文章目录