简体   繁体   English

TypeError:'NoneType'对象不可调用,我该如何解决?

[英]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.

相关问题 解决 TypeError: 'NoneType' object is not callable in webscraper - Solve TypeError: 'NoneType' object is not callable in webscraper 我该如何解决: TypeError: 'NoneType' object is not iterable - How can I solve : TypeError: 'NoneType' object is not iterable 如何解决 TypeError: 'NoneType' object is not iterable in pyhton - how can I solve TypeError: 'NoneType' object is not iterable in pyhton 我该如何解决不能使用BeautifulSoup和Bottle调用NoneType对象的问题? - How do I solve NoneType object is not callable with BeautifulSoup and Bottle? TypeError:NoneType 对象不可调用 - TypeError: NoneType object is not callable 如何修复“TypeError: 'NoneType' 对象不可调用” - How To Fix “TypeError: 'NoneType' object is not callable” TypeError TypeError: 'NoneType' object 不可调用 - TypeError TypeError: 'NoneType' object is not callable 我该如何解决这个 TypeError: 'NoneType' object is not subscriptable? - How do i solve this TypeError: 'NoneType' object is not subscriptable? TypeError: 'list' object 不可调用; 这是什么意思,我该如何解决? - TypeError : 'list' object is not callable; What does it mean and how can I solve it? TypeError:“ NoneType”对象不可调用,但对象不是nonetype - TypeError: 'NoneType' object is not callable but object is not nonetype
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM