我想做一个游戏,当这个循环运行时,它会崩溃
while poterbar_hunt_pone == True and ptwo_shot == True:
if poterbarx < xone+carone_width:
poterbar_dir = "right"
poterbarx_c = 20
else:
poterbar_dir = "left"
poterbarx_c = -20
if poterbary+poterbarh < yone:
poterbary_c = 20
else:
poterbary_c = -20
if poterbarx <= xone+carone_width and poterbarx+poterbarw >= xone:
if poterbary+poterbarh >= yone and poterbary <= yone+carone_height:
xone_change = random.randrange (-20, 20)
yone_change = random.randrange (-20, 20)
poterbar_hunt_pone = False
ptwo_shot = False
poterbarx = -100
poterbary = -100
当这两个值都为真时,pygame崩溃了,我想是在波特的运动中。 如果你们中有人知道是什么导致pygame崩溃请告诉我
您缺少
pygame.display.update()
。你知道吗将此添加到代码的最底部,使其看起来像:
相关问题 更多 >
编程相关推荐