如何摆脱DeprecationWarning?

时间:2020-06-14 16:14:47

标签: python pygame

我一直收到这个“警告”:

DeprecationWarning: an integer is required (got type float).  
  Implicit conversion to integers using __int__ is deprecated, 
  and may be removed in a future version of Python.
screen.blit(enemyImg[u], (x, y))

这是我怀疑错误的来源:

def isCollision(eX, eY, bX, bY):
    distance = math.sqrt(math.pow(int(eX) - int(bX), 2) + math.pow(int(eY) - int(bY), 2))
    if distance < 27:
        return True
    else:
        return False

0 个答案:

没有答案