load selected level

main
Mike 2023-03-28 12:45:22 +02:00
parent 0d25ce06c5
commit 14a057cbba
1 changed files with 6 additions and 2 deletions

View File

@ -53,8 +53,12 @@ if what_to_run == 'menu':
level_menu_width = screen_width / 2
level_menu_height = screen_height / 2
level_menu = LevelMenu(parsed_levels_manager.levels, 0, 0, level_menu_width, level_menu_height, 3)
level_menu.level_select_listener = lambda selected_level: print(selected_level.name, "selected")
# generated_level.load_level(selected_level)
def load_next_level(selected_level):
generated_level.destroy_level()
generated_level.load_level(selected_level)
level_menu.level_select_listener = lambda selected_level: load_next_level(selected_level)
for level_text_label in level_menu.level_text_labels:
sprite_manager.add_ui_element(DrawLayers.UI, level_text_label)