飞机大战报错
Traceback (most recent call last):File "D:\project\gameplane\gameplane.py", line 76, in <module>
main()
File "D:\project\gameplane\gameplane.py", line 45, in main
me = myplane.MyPlane(bg_size)
File "C:\Users\23627\AppData\Local\Programs\Python\Python310\lib\site-packages\pygame\sprite.py", line 116, in __init__
self.add(*groups)
File "C:\Users\23627\AppData\Local\Programs\Python\Python310\lib\site-packages\pygame\sprite.py", line 134, in add
self.add(*group)
File "C:\Users\23627\AppData\Local\Programs\Python\Python310\lib\site-packages\pygame\sprite.py", line 134, in add
self.add(*group)
TypeError: pygame.sprite.Sprite.add() argument after * must be an iterable, not int
实例化 me = myplane.MyPlane(bg_size)飞机时
bg_size 警告 Expected type 'AbstractGroup', got 'tuple' instead 完整代码。 KeyError 发表于 2023-1-13 12:25
完整代码。
已解决感谢,pycharm 快捷输入 __init__选成 __int__
页:
[1]