为什么我的代码不显示我编码的胜利画面就不停地运行?

时间:2019-04-18 00:23:19

标签: python python-3.x pygame

我的精灵一直在运行,胜利屏幕也不会出现……为什么?

请快速回答我有点急

我尝试重新排列代码,但似乎无济于事。

#VICTORY SCREEN - appears at the end of the game
#Moving onto the next level as the player moves on & ending the game
current_position = player.rect.x + current_level.world_shift
if current_position < current_level.level_limit:
    if current_level_no < len(level_list)-1:
        player.rect.x = 120
        current_level_no += 1
        current_level = level_list[current_level_no]
        player.level = current_level
    else:
        victory = True

if victory:
    screen.fill((0, 0, 0))
    victory_text = font1.render("Great Job! You win the game!",True,(255,255,255))
    the_end = font2.render("Press Enter to Exit",True,(255,255,255))

    screen.blit(victory_text,(468 - (victory_text.get_width() // 2), 328 - (victory_text.get_height() // 2)))
    screen.blit(the_end, (468 - (the_end.get_width() // 2), (248 - (the_end.get_height() // 2)) + victory_text.get_height()

结果: 子画面应停在关卡中的某个点,然后出现胜利屏幕。

0 个答案:

没有答案