0
我有一些问题,使用pygame的的collidepoint
方法通过其他类:无法使用pygames collidepoint与其他类
if(mouseclick[0]):
for tile in self.engine.level.levellist:
if tile.collidepoint(mousepos):
这种体积小,易于代码给我一个错误:
if tile.collidepoint(mousepos):
AttributeError: TileClass instance has no attribute 'collidepoint'
任何人知道我做错了什么?过了一段时间,因为我使用Python,我可能只是缺少一些容易修复。
定义了“TileClass”的位置?你只是没有给它一个“碰撞点”属性。 – Veedrac