def missions(screen: Af.Surface): Af.play(change_menu_sound) y_coo = [y for y in range(107, 600, 80)] effects_game = [ "m_endless", "m_aim", "missions", "missions", "missions", "game_menu" ] buttons = Af.create_buttons(mc.Button, "menu/buttons/11", effects_game, y_coo) effects_coo = { 0: (687, 90), 1: (687, 90), 2: (687, 192), 3: (687, 178), 4: (687, 178), 5: (687, 178) } effects = [Af.load_image(f"menu/effects/3/{i + 1}.png") for i in range(4)] user = mc.User() user.get_active_user() user.get_texts() missions_menu = mc.User_Menu(screen, f"menu/interfaces/Main/missions menu.png", buttons, effects_coo, effects, user) next_link = missions_menu.display_menu() Af.write_file_content( "parameters/prev_men.txt", "game_menu") # make sure any submenu returns to Game Menu after return next_link
def tutorial(screen: Af.Surface): Af.play(change_menu_sound) position_x_tutorial = (1080 - 260) // 2 position_y_tutorial = [y for y in range(110, 600, 100)] effects_tutorial = ["controls", "save", "enemy", "level_up", "game_menu"] buttons = [ mc.Button(position_x_tutorial, y, f"menu/buttons/4/{position_y_tutorial.index(y) + 1}.png", effects_tutorial[position_y_tutorial.index(y)]) for y in position_y_tutorial[:len(effects_tutorial)] ] button_coo = { 0: (680, 90), 1: (680, 90), 2: (698, 192), 3: (685, 178), 4: (685, 178) } effects = [Af.load_image(f"menu/effects/1/{i + 1}.png") for i in range(4)] user = mc.User() user.get_active_user() user.get_texts() tutorial_menu = mc.User_Menu(screen, f"menu/interfaces/Main/tutorial.png", buttons, button_coo, effects, user) Af.write_file_content( "parameters/prev_men.txt", "game_menu") # make sure any submenu returns to Game Menu after return tutorial_menu.display_menu()
def game_menu(screen: Af.Surface): Af.play(change_menu_sound) y_coo = [y for y in range(107, 600, 80)] b_effects = ["story", "m_ai", "missions", "tutorial", "manage", "exit2"] buttons = Af.create_buttons(mc.Button, "menu/buttons/2", b_effects, y_coo) effects_coo = { 0: (687, 90), 1: (687, 90), 2: (687, 192), 3: (687, 178), 4: (687, 178), 5: (687, 178) } effects = [Af.load_image(f"menu/effects/3/{i + 1}.png") for i in range(4)] user = mc.User() user.get_active_user() user.get_texts() g_menu = mc.Game_Menu(screen, f"menu/interfaces/Main/game menu.png", buttons, effects_coo, effects, user) next_link = g_menu.display_menu() if next_link == "m_ai": mission_is_unlocked = int( Af.read_file_content(f"saves/{user.name}/next_level.txt", 1)[0]) if not mission_is_unlocked: next_link = "nx_l" Af.write_file_content( "parameters/prev_men.txt", "game_menu") # make sure any submenu returns to Game Menu after return next_link
def management_user(screen: Af.Surface): Af.write_file_content( "parameters/prev_men.txt", "manage") # make sure any submenu returns to management after Af.play(change_menu_sound) y_coo = [110, 190, 270, 510] effects = ["change_password", "delete_account", "manage_us", "manage"] buttons = Af.create_buttons(mc.Button, "menu/buttons/12", effects, y_coo) effects_coo = { 0: (687, 90), 1: (687, 90), 2: (687, 192), 3: (687, 178), 4: (687, 178) } effects = [Af.load_image(f"menu/effects/3/{i + 1}.png") for i in range(4)] user = mc.User() user.get_active_user() user.get_texts() directory = "menu/interfaces/Main/management_account.png" # directory for the background image of the menu m_user_menu = mc.User_Menu(screen, directory, buttons, effects_coo, effects, user) next_link = m_user_menu.display_menu() return next_link