我在其他地方读过类似的问题,但它说的只是在函数定义中添加“self”。当我检查这个文件是self时,它实际上已经有self关键字了!回溯如下:
Traceback (most recent call last):
File "C:\Users\Brenda\Documents\The Nick Folder\Mobile Fortress War 3\MFWRT3 - TileClass test\Title.pyw", line 142, in <module>
SelectServer.main()
File "C:\Users\Brenda\Documents\The Nick Folder\Mobile Fortress War 3\MFWRT3 - TileClass test\SelectServer.pyw", line 44, in main
Main.mainloop()
File "C:\Users\Brenda\Documents\The Nick Folder\Mobile Fortress War 3\MFWRT3 - TileClass test\Main.pyw", line 72, in mainloop
globals.alltiles.update()
File "C:\Python32\lib\site-packages\pygame\sprite.py", line 462, in update
s.update(*args)
TypeError: update() takes no arguments (1 given)
我这样称呼它:
^{pr2}$有人能帮忙吗?在
我有点晚了,但可能是因为每个卡的update方法声明不正确(我假设它是子类化的)游戏精灵精灵精灵)在
它应该声明为“def update(self)”,而不是“def update()”
如果没有代码来调试,这将是一个猜谜游戏,但为了将来的参考,精灵组是这样创建的:
相关问题 更多 >
编程相关推荐