[英]TypeError: 'NoneType' object is not callable , how can i solve it?
i`m trying to make a game , but this error happens with my collision def 我正在尝试制作游戏,但是我的碰撞定义发生了此错误
thats the code: 多数民众赞成在代码:
def colisao(espeto):
for b in range(len(espeto)) :
if player.collided(espeto[b]):
if b == 0 :
espeto [0].x = janela.width / 2
espeto [0].y = janela.height - espeto [0].height
elif b == 1:
espeto [b].y = janela.height - espeto [0].height
espeto [b].x = espeto [0].x + janela.width / 3
elif b != 1:
espeto [b].y = janela.height - espeto [0].height
espeto [b].x = janela.width / 2 + espeto [b - 1].x
then i put in the game loop this function 然后我把这个功能放在游戏循环中
is_colliding = colisao(espeto_f1)
and when i execute , this happens :/ 当我执行时,会发生这种情况:/
PS : Sorry for bad english , i`m learning the language , yet PS:对不起,英语不好,我正在学习英语,但是
It is very likely that player.collided
is None, instead of a function/method. player.collided
很可能是None,而不是函数/方法。 Please check that. 请检查一下。 This is the only thing I can guess with the details given.
这是我唯一能猜出的细节。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.