我正在尝试使用pygame创建一个游戏,而现在我正试图点击我的健康栏。它显然存在于背景图像之下。有没有办法让它在背景上显示blit / draw?我试过重新安排订单。
screen.blit(healthbar, (5,5))
for health1 in range(healthvalue):
screen.blit(health, (health1+8,8))
screen.blit(background,(0,0))
建议还是我这样做完全错了?
答案 0 :(得分:1)
订单错误,您应该在绘制完所有内容后更新屏幕:
screen.blit(backround,(0,0))
screen.blit(healthbar, (5,5))
for health1 in range(healthvalue):
screen.blit(health, (health1+8,8))
...
pygame.display.flip()