本文整理汇总了Python中Menu.Menu.level_select方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.level_select方法的具体用法?Python Menu.level_select怎么用?Python Menu.level_select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu.Menu
的用法示例。
在下文中一共展示了Menu.level_select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Menu import Menu [as 别名]
# 或者: from Menu.Menu import level_select [as 别名]
#.........这里部分代码省略.........
elif option == 4:
"""links"""
current_state = "links"
elif option == 5:
"""credits"""
current_state = "credits"
elif option == 6:
"""quit"""
done = True
main_menu.render(screen)
screen.blit(menu_cursor_image, (mouse_pos[0]-16, mouse_pos[1]-16))
pygame.display.flip()
elif current_state == "help":
main_menu.help_screen(screen,mouse_pos)
pressed_keys = pygame.key.get_pressed()
if pressed_keys[pygame.K_ESCAPE]:
current_state = "menu"
pygame.display.flip()
elif current_state == "links":
if main_menu.links(screen,mouse_pos,time_passed_seconds) == "link":
current_state = "menu"
pressed_keys = pygame.key.get_pressed()
if pressed_keys[pygame.K_ESCAPE]:
current_state = "menu"
pygame.display.flip()
elif current_state == "level select":
selected_level = main_menu.level_select(screen, mouse_pos, time_passed_seconds, main_world)
if selected_level is not None:
current_state = "game"
main_world.game_over = False
pygame.mixer.music.stop()
main_world.set_up_level(selected_level)
main_world.level_index = main_world.levels.index(selected_level)
pressed_keys = pygame.key.get_pressed()
if pressed_keys[pygame.K_ESCAPE]:
current_state = "menu"
pygame.display.flip()
elif current_state == "credits":
main_menu.credits(screen,mouse_pos,time_passed_seconds)
pressed_keys = pygame.key.get_pressed()
if pressed_keys[pygame.K_ESCAPE]:
current_state = "menu"
pygame.display.flip()
elif current_state == "game":
movement = vec2()
pressed_keys = pygame.key.get_pressed()
if pressed_keys[pygame.K_a]:
movement.x -= 1
if pressed_keys[pygame.K_d]:
movement.x += 1
if pressed_keys[pygame.K_w]:
movement.y -= 1
if pressed_keys[pygame.K_s]:
movement.y += 1