以下是代码:
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"
我无法找到任何可以帮助我解决此特定错误的内容。有人可以帮忙吗?