gpt4 book ai didi

python - TypeError : object. __new__ 没有参数

转载 作者:太空宇宙 更新时间:2023-11-04 10:42:02 25 4
gpt4 key购买 nike

代码如下:

class Display:
def ___init___(self,width,height):
self.screenWidth = width
self.screenHeight = height
#self.background1 = pygame.image.load("background1.png")
#self.backplace = self.background1.get_rect()
# Initialize screen

self.size = self.width, self.height = self.screenWidth, self.screenHeight
self.screen = pygame.display.set_mode(self.size)
# Loaded only once to save time
#self.healthImage = pygame.image.load("healthbetter.png").convert_alpha()
self.somethingChanged = False # Nothing changed, no need to draw screen
self.scrollOffset = 0
mathclass = Mathclass(self.screen)

这是错误:

"Traceback (most recent call last):
File "C:\Documents and Settings\Noam\My Documents\games by me\first project\first project.py", line 302, in <module>
display = Display(640,480)
TypeError: object.__new__() takes no parameters"

我找不到任何可以帮助我解决这个特定错误的东西。有人可以帮忙吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com