嗨,这是我第一次尝试用 python 编写视频游戏。所以我找到了一个教程视频,它与我的(mac)在同一操作系统上运行,但是当我在视频中编写设置时:
#Setup
import turtle
wn=turtle.Screen
wn.title("Pong")
wn.bgcolor("black")
wn.setup(width=800, heigth=600)
wn.tracer(0)
#Main game loop
while True:
wn.update()
出现了这个错误:
AttributeError: 'function' object has no attribute 'title'
有谁知道这意味着什么以及如何解决它?顺便说一句,我正在运行 python 3.10.0