我有另一个Python错误,现在是一个TypeError .....这是错误,
Traceback (most recent call last):
File "C:/Users/dongjune/Desktop/PyCharm/PyFlying/PyFlying7.py", line 194, in
<module>
initGame()
File "C:/Users/dongjune/Desktop/PyCharm/PyFlying/PyFlying7.py", line 190,
in initGame
runGame()
File "C:/Users/dongjune/Desktop/PyCharm/PyFlying/PyFlying7.py", line 146, in
runGame
drawObject(bat, bat_x, bat_y)
File "C:/Users/dongjune/Desktop/PyCharm/PyFlying/PyFlying7.py", line 21, in
drawObject
gamepad.blit(obj, (x,y))
TypeError: invalid destination position for blit
这是drawObject,
def drawObject(obj, x, y):
global gamepad
gamepad.blit(obj, (x,y))
第145至154行:
if not isShotBat:
drawObject(bat, bat_x, bat_y)
else:
drawObject(boom, bat_x, bat_y)
boom_count += 1
if boom_count > 5:
boom_count = 0
bat_x = pad_width
bat_y = random.randrange
isShotBat = False
现在是runGame的顶部...
def runGame():
global gamepad, aircraft, clock, background1, background2
global bat, fires, bullet, boom
isShotBat = False
boom_count = 0
请修正此错误!!!