我制作了一个非常简单的 Pygame Zero 游戏,但是我的 Actor 图像和 screen.clear() 不起作用你能帮我解决这个问题吗?

问题描述

这是非常糟糕的游戏示例的完整代码

import pgzrun
from random import randint
from pgzero.builtins import Actor,animate,keyboard

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.collidepont(pos):
        print("Good shot!")
        place_apple()
    else:
        print("You missed!")
        quit()

place_apple()
pgzrun.go()

screen.clear() 不起作用,apple = actor("apple") 也不起作用。我不知道为什么。请帮帮我!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)