python中pygame的报错

为什么每次运行一个pygame的程序时会出现这个↓?怎么办?

File "C:\Users\lyb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pygame\sprite.py", line 115, in __init__
self.add(*groups)
File "C:\Users\lyb\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pygame\sprite.py", line 133, in add
self.add(*group)
TypeError: add() argument after * must be an iterable, not pygame.Surface

pygame模块中的函数的参数使用不正确,导致函数出现异常,sprite.py本身是没有问题的,你看看你的第115行代码是不是写错了

add只能添加精灵对象或精灵组,你传入了一个Surface对象进去,所以报错
检查一下对应的代码部分是否写错了