Esempio n. 1
0
    def init_offline_menu(self):

        play_offline_menu_versus_ia_game_button = Button(
            text_start_game_versus_ia,
            play_offline_menu_versus_ia_game_button_px,
            play_offline_menu_versus_ia_game_button_py,
            action=self.create_game_versus_ia)
        play_offline_menu_tutorial_game_button = Button(
            text_tutotial,
            play_offline_menu_tutorial_game_button_px,
            play_offline_menu_tutorial_game_button_py,
            action=self.create_game_tutorial)

        play_offline_menu_test_game_button = Button(
            text_test_game,
            play_offline_menu_test_game_button_px,
            play_offline_menu_test_game_button_py,
            action=self.create_game)

        play_offline_menu_return_to_main_menu_button = Button(
            text_return_to_menu,
            play_offline_menu_return_to_main_menu_button_px,
            play_offline_menu_return_to_main_menu_button_py)

        self.offline_game_menu = Menu(
            self.main_menu,
            buttons=[
                play_offline_menu_versus_ia_game_button,
                play_offline_menu_tutorial_game_button,
                play_offline_menu_test_game_button
            ],
            quit_button=play_offline_menu_return_to_main_menu_button)
Esempio n. 2
0
    def init_in_game_menu(self):

        in_game_menu_rect = RectCenter(in_game_menu_px, in_game_menu_py,
                                       in_game_menu_width, in_game_menu_height)

        in_game_menu_capitulate_button = Button(
            text_capitulate_game,
            in_game_menu_capitulate_button_px,
            in_game_menu_capitulate_button_py,
            action=self.launch_confirm_capitulate_menu)

        in_game_menu_options_button = Button(
            text_options,
            in_game_menu_options_button_px,
            in_game_menu_options_button_py,
            action=self.parent.launch_options_menu)

        in_game_menu_return_to_game_button = Button(
            text_return_to_game, in_game_menu_return_to_game_button_px,
            in_game_menu_return_to_game_button_py)

        self.in_game_menu = Menu(
            self,
            buttons=[
                in_game_menu_capitulate_button, in_game_menu_options_button
            ],
            quit_button=in_game_menu_return_to_game_button,
            rect=in_game_menu_rect)
Esempio n. 3
0
    def init_online_menu(self):

        play_online_menu_2_players_game_button = Button(
            text_start_2_players_game,
            play_online_menu_2_players_game_button_px,
            play_online_menu_2_players_game_button_py,
            action=self.launch_work_in_progress_menu)

        play_online_menu_3_players_game_button = Button(
            text_start_3_players_game,
            play_online_menu_3_players_game_button_px,
            play_online_menu_3_players_game_button_py,
            action=self.launch_work_in_progress_menu)

        play_online_menu_return_to_main_menu_button = Button(
            text_return_to_menu, oneline_menu_return_to_main_menu_button_px,
            oneline_menu_return_to_main_menu_button_py)

        self.online_game_menu = Menu(
            self.main_menu,
            buttons=[
                play_online_menu_2_players_game_button,
                play_online_menu_3_players_game_button
            ],
            quit_button=play_online_menu_return_to_main_menu_button)
Esempio n. 4
0
    def init_confirm_capitulate_menu(self):

        confirm_capitulate_menu_rect = RectCenter(
            quit_game_menu_px, quit_game_menu_py,
            confirm_capitulate_menu_width, confirm_capitulate_menu_height)

        confirm_capitulate_menu_message = Message(
            confirm_capitulate_menu_message_px,
            confirm_capitulate_menu_message_py, text_capitulate_game_question)

        confirm_capitulate_menu_yes_button = Button(
            text_yes,
            confirm_capitulate_menu_yes_button_px,
            confirm_capitulate_menu_yes_button_py,
            action=self.capitulate)
        confirm_capitulate_menu_no_button = Button(
            text_no, confirm_capitulate_menu_no_button_px,
            confirm_capitulate_menu_no_button_py)

        self.confirm_capitulate_menu = Menu(
            self,
            quit_button=confirm_capitulate_menu_no_button,
            buttons=[confirm_capitulate_menu_yes_button],
            messages=[confirm_capitulate_menu_message],
            rect=confirm_capitulate_menu_rect)
Esempio n. 5
0
    def init_end_game_menu(self):

        end_game_menu_rect = RectCenter(end_game_menu_px, end_game_menu_py,
                                        end_game_menu_width,
                                        end_game_menu_height)

        end_game_menu_continue_button = Button(
            text_continue,
            end_game_menu_continue_button_px,
            end_game_menu_continue_button_py,
            action=self.end_game)

        self.end_game_menu = Menu(self,
                                  quit_button=end_game_menu_continue_button,
                                  messages=[],
                                  rect=end_game_menu_rect)
Esempio n. 6
0
    def init_work_in_progress_menu(self):

        work_in_progress_menu_rect = RectCenter(work_in_progress_menu_px,
                                                work_in_progress_menu_py,
                                                work_in_progress_menu_width,
                                                work_in_progress_menu_height)

        work_in_progress_menu_message = Message(
            work_in_progress_menu_message_px, work_in_progress_menu_message_py,
            text_work_in_progress)

        work_in_progress_menu_quit_button = Button(
            text_validate, work_in_progress_menu_quit_button_px,
            work_in_progress_menu_quit_button_py)

        self.work_in_progress_menu = Menu(
            self.main_menu,
            quit_button=work_in_progress_menu_quit_button,
            messages=[work_in_progress_menu_message],
            rect=work_in_progress_menu_rect)
Esempio n. 7
0
    def init_quit_game_menu(self):

        quit_game_menu_rect = RectCenter(quit_game_menu_px, quit_game_menu_py,
                                         quit_game_menu_width,
                                         quit_game_menu_height)

        quit_game_menu_message = Message(quit_game_menu_message_px,
                                         quit_game_menu_message_py,
                                         text_quit_game_question)

        quit_game_menu_yes_button = Button(text_yes,
                                           quit_game_menu_yes_button_px,
                                           quit_game_menu_yes_button_py,
                                           action=self.exit)
        quit_game_menu_no_button = Button(text_no, quit_game_menu_no_button_px,
                                          quit_game_menu_no_button_py)

        self.quit_game_menu = Menu(self,
                                   quit_button=quit_game_menu_no_button,
                                   buttons=[quit_game_menu_yes_button],
                                   messages=[quit_game_menu_message],
                                   rect=quit_game_menu_rect)
Esempio n. 8
0
    def init_main_menu(self):
        main_menu_play_online_button = Button(
            text_online_menu,
            main_menu_play_online_button_px,
            main_menu_play_online_button_py,
            action=self.launch_online_game_menu)

        main_menu_play_offline_button = Button(
            text_offline_menu,
            main_menu_play_offline_button_px,
            main_menu_play_offline_button_py,
            action=self.launch_offline_game_menu)

        main_menu_option_button = Button(text_options,
                                         main_menu_option_button_px,
                                         main_menu_option_button_py,
                                         action=self.launch_options_menu)

        main_menu_chest_button = Button(
            text_chest,
            main_menu_chest_button_px,
            main_menu_chest_button_py,
            action=self.launch_work_in_progress_menu)

        main_menu_quit_button = Button(text_quit_game,
                                       main_menu_quit_button_px,
                                       main_menu_quit_button_py,
                                       action=self.launch_quit_game_menu)

        self.main_menu = Menu(self,
                              buttons=[
                                  main_menu_play_online_button,
                                  main_menu_play_offline_button,
                                  main_menu_option_button,
                                  main_menu_chest_button, main_menu_quit_button
                              ])
Esempio n. 9
0
    def init_options_menu(self):

        options_menu_french_button = Button(None,
                                            options_menu_french_button_px,
                                            options_menu_french_button_py,
                                            image=french_flag_image_key,
                                            action=load_texts,
                                            parameters=(french_key))

        options_menu_english_button = Button(None,
                                             options_menu_english_button_px,
                                             options_menu_english_button_py,
                                             image=english_flag_image_key,
                                             action=load_texts,
                                             parameters=(english_key))

        options_menu_choose_element_message = Message(
            options_menu_choose_element_message_px,
            options_menu_choose_element_message_py, text_choose_color)

        options_menu_red_choice = ColorBox(options_menu_red_choice_px,
                                           options_menu_red_choice_py,
                                           red,
                                           name='player_color')
        options_menu_blue_choice = ColorBox(options_menu_blue_choice_px,
                                            options_menu_blue_choice_py,
                                            blue,
                                            name='player_color')
        options_menu_yellow_choice = ColorBox(options_menu_yellow_choice_px,
                                              options_menu_yellow_choice_py,
                                              yellow,
                                              name='player_color')
        options_menu_green_choice = ColorBox(options_menu_green_choice_px,
                                             options_menu_green_choice_py,
                                             green,
                                             name='player_color')
        options_menu_brown_choice = ColorBox(options_menu_brown_choice_px,
                                             options_menu_brown_choice_py,
                                             brown,
                                             name='player_color')
        options_menu_grey_choice = ColorBox(options_menu_grey_choice_px,
                                            options_menu_grey_choice_py,
                                            grey,
                                            name='player_color')
        options_menu_purple_choice = ColorBox(options_menu_purple_choice_px,
                                              options_menu_purple_choice_py,
                                              purple,
                                              name='player_color')
        options_menu_clear_blue_choice = ColorBox(
            options_menu_clear_blue_choice_px,
            options_menu_clear_blue_choice_py,
            clearblue,
            name='player_color')

        options_online_menu_return_to_main_menu_button = Button(
            text_return_to_menu,
            options_online_menu_return_to_main_menu_button_px,
            options_online_menu_return_to_main_menu_button_py)

        self.options_menu = Menu(
            self.main_menu,
            buttons=[options_menu_french_button, options_menu_english_button],
            colors=[
                options_menu_red_choice, options_menu_blue_choice,
                options_menu_yellow_choice, options_menu_green_choice,
                options_menu_brown_choice, options_menu_grey_choice,
                options_menu_purple_choice, options_menu_clear_blue_choice
            ],
            messages=[options_menu_choose_element_message],
            quit_button=options_online_menu_return_to_main_menu_button)
Esempio n. 10
0
    def init_connexion_menu(self):

        connexion_menu_choose_name_message = Message(
            connexion_menu_choose_name_message_px,
            connexion_menu_choose_name_message_py, text_enter_login)

        connexion_menu_name_input_box = InputBox(
            connexion_menu_name_input_box_px,
            connexion_menu_name_input_box_py,
            "",
            name='player_name')

        connexion_menu_choose_element_message = Message(
            connexion_menu_choose_element_message_px,
            connexion_menu_choose_element_message_py, text_choose_color)

        connexion_menu_red_choice = ColorBox(connexion_menu_red_choice_px,
                                             connexion_menu_red_choice_py,
                                             red,
                                             name='player_color')
        connexion_menu_blue_choice = ColorBox(connexion_menu_blue_choice_px,
                                              connexion_menu_blue_choice_py,
                                              blue,
                                              name='player_color')
        connexion_menu_yellow_choice = ColorBox(
            connexion_menu_yellow_choice_px,
            connexion_menu_yellow_choice_py,
            yellow,
            name='player_color')
        connexion_menu_green_choice = ColorBox(connexion_menu_green_choice_px,
                                               connexion_menu_green_choice_py,
                                               green,
                                               name='player_color')
        connexion_menu_brown_choice = ColorBox(connexion_menu_brown_choice_px,
                                               connexion_menu_brown_choice_py,
                                               brown,
                                               name='player_color')
        connexion_menu_grey_choice = ColorBox(connexion_menu_grey_choice_px,
                                              connexion_menu_grey_choice_py,
                                              grey,
                                              name='player_color')
        connexion_menu_purple_choice = ColorBox(
            connexion_menu_purple_choice_px,
            connexion_menu_purple_choice_py,
            purple,
            name='player_color')
        connexion_menu_clear_blue_choice = ColorBox(
            connexion_menu_clear_blue_choice_px,
            connexion_menu_clear_blue_choice_py,
            clearblue,
            name='player_color')

        connexion_menu_connect_button = Button(
            text_connexion,
            connexion_menu_connect_button_px,
            connexion_menu_connect_button_py,
            action=self.launch_main_menu)

        connexion_menu_quit_button = Button(text_quit_game,
                                            connexion_menu_quit_button_px,
                                            connexion_menu_quit_button_py,
                                            action=self.launch_quit_game_menu)

        connexion_menu_french_button = Button(None,
                                              connexion_menu_french_button_px,
                                              connexion_menu_french_button_py,
                                              image=french_flag_image_key,
                                              action=load_texts,
                                              parameters=(french_key))

        connexion_menu_english_button = Button(
            None,
            connexion_menu_english_button_px,
            connexion_menu_english_button_py,
            image=english_flag_image_key,
            action=load_texts,
            parameters=(english_key))

        self.connexion_menu = Menu(
            self,
            buttons=[
                connexion_menu_french_button, connexion_menu_english_button,
                connexion_menu_connect_button, connexion_menu_quit_button
            ],
            inputs=[connexion_menu_name_input_box],
            messages=[
                connexion_menu_choose_name_message,
                connexion_menu_choose_element_message
            ],
            colors=[
                connexion_menu_red_choice, connexion_menu_blue_choice,
                connexion_menu_yellow_choice, connexion_menu_green_choice,
                connexion_menu_brown_choice, connexion_menu_grey_choice,
                connexion_menu_purple_choice, connexion_menu_clear_blue_choice
            ])