import pgzero//从随机进口中导入进口博弈: apple = Actor("apple")
def draw():
screen.clear()
apple.draw()
def place_apple():
apple.x = randint(10, 800)
apple.y = randint(10, 600)
def on_mouse_down(pos):
if apple.collidepoint(pos):
print("Good Shot!")
place_apple()
else:
print("You Missed!")
quit()发布于 2022-06-07 20:26:41
在if语句之后,您确实丢失了一个缩进。它应该是:
def on_mouse_down(pos):
if apple.collidepoint(pos):
print("Good Shot!")
place_apple()
else:
print("You Missed!")
quit()https://stackoverflow.com/questions/72537170
复制相似问题