[英]Solve TypeError: 'NoneType' object is not callable in webscraper
[英]TypeError: 'NoneType' object is not callable , how can i solve it?
我正在嘗試制作游戲,但是我的碰撞定義發生了此錯誤
多數民眾贊成在代碼:
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
然后我把這個功能放在游戲循環中
is_colliding = colisao(espeto_f1)
當我執行時,會發生這種情況:/
PS:對不起,英語不好,我正在學習英語,但是
player.collided
很可能是None,而不是函數/方法。 請檢查一下。 這是我唯一能猜出的細節。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.