我正在尝试使用pygame库对游戏进行编程,但由于某种原因,它一直在抛出TypeError:预期为integer参数,以下行出现了float错误:
if surface.get_at((player["x"], player["y"] + player["height"])) == (0,0,0,255):
leftOfPlayerOnPlatform = False
if surface.get_at((player["x"] + player["width"], player["y"] + player["height"])) == (0,0,0,255):
rightOfPlayerOnPlatform = False
if leftOfPlayerOnPlatform is False and rightOfPlayerOnPlatform is False and (player["y"] + player["height"]) + player["vy"] < windowHeight:
player["y"] += player["vy"]
我使用Thonny来运行代码。如果有人可以帮助我解决我的问题,我将不胜感激。
手掌心