|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 lzblm 于 2021-2-12 10:27 编辑
我在使用完美碰撞检测时,报错了显示了下面的内容,怀疑椒pygame的问题
Traceback (most recent call last):
File "Python39\lib\site-packages\pygame\sprite.py", line 1613, in collide_mask
leftmask = left.mask
AttributeError: 'MyPlane' object has no attribute 'mask'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "zhu.py", line 207, in <module>
main()
File "zhu.py", line 172, in main
enemies_down = pygame.sprite.spritecollide(me,enemies,False,pygame.sprite.collide_mask)
File "Python39\lib\site-packages\pygame\sprite.py", line 1665, in spritecollide
return [group_sprite
File "Python39\lib\site-packages\pygame\sprite.py", line 1667, in <listcomp>
if collided(sprite, group_sprite)]
File "Python39\lib\site-packages\pygame\sprite.py", line 1615, in collide_mask
leftmask = from_surface(left.image)
AttributeError: 'MyPlane' object has no attribute 'image'
我更新了pygame又报错了显示:
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the 'python.exe -m pip install --upgrade pip' command.
怎么办
pygame 官方自带模块一般没有问题, 多检查自己代码
|
|