Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
def main_menu(screen: Af.Surface):
    Af.stop_all_sounds()
    Af.play(change_menu_sound)
    buttons = Af.create_buttons(mc.Button, "menu/buttons/1",
                                ["choose", "new", "exit1"])
    button_coo = {0: (680, 90), 1: (698, 192), 2: (685, 178)}
    effects = [Af.load_image(f"menu/effects/1/{i + 1}.png") for i in range(4)]
    m_m = mc.Basic_Menu(screen, f"menu/interfaces/Main/main menu.png", buttons,
                        button_coo, effects)
    return m_m.display_menu()
Esempio n. 4
0
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