コード例 #1
0
    def initiate(self):
        from src.game_core_module.game import Game

        # new world button
        start_new_game_button = Button(12, 9, 11, 2, 'Create new world',
                                       lambda: Game.set_app_state(AppStates.NEW_GAME_MENU))
        start_new_game_button.activate()
        self.nodes.append(start_new_game_button)

        # load game button
        load_game_button = Button(12, 12, 11, 2, 'Load game',
                                  lambda: Game.set_app_state(AppStates.LOAD_GAME_MENU))
        load_game_button.activate()
        self.nodes.append(load_game_button)
        
        # controls button
        controls_button = Button(12, 15, 11, 2, 'Controls',
                                 lambda: Game.set_app_state(AppStates.CONTROLS))
        controls_button.activate()
        self.nodes.append(controls_button)

        # about button
        about_button = Button(12, 18, 11, 2, 'About',
                              lambda: Game.set_app_state(AppStates.ABOUT))
        about_button.activate()
        self.nodes.append(about_button)
コード例 #2
0
    def initiate(self):
        from src.game_core_module.game import Game

        self.nodes.append(InGameMenuPanel(7, 13))

        self.nodes.append(BigText(13, 8, 9, 2, 'PAUSED'))

        # save button
        save_button = Button(
            12, 11, 11, 2, 'Save',
            lambda: Game.set_app_state(AppStates.IN_GAME_SAVE_GAME))
        save_button.activate()
        self.nodes.append(save_button)

        # unpause button
        unpause_button = Button(
            12, 14, 11, 2, 'Unpause',
            lambda: Game.set_app_state(AppStates.IN_GAME_PLAY))
        unpause_button.activate()
        self.nodes.append(unpause_button)

        # exit button
        exit_button = Button(
            12, 17, 11, 2, 'Exit',
            lambda: Game.set_app_state(AppStates.IN_GAME_CONFIRM_EXIT))
        exit_button.activate()
        self.nodes.append(exit_button)
コード例 #3
0
ファイル: new_game_view.py プロジェクト: matszach/wildrealm
    def initiate(self):
        from src.game_core_module.game import Game

        # new game buttons
        tiny_world_button = Button(12, 6, 11, 2, f'Tiny [256x256]',
                                   lambda: Game.start_new_game(256))
        tiny_world_button.activate()
        self.nodes.append(tiny_world_button)
        small_world_button = Button(12, 9, 11, 2, f'Small [512x512]',
                                    lambda: Game.start_new_game(512))
        small_world_button.activate()
        self.nodes.append(small_world_button)
        medium_world_button = Button(12, 12, 11, 2, f'Medium [1024x1024]',
                                     lambda: Game.start_new_game(1024))
        medium_world_button.activate()
        self.nodes.append(medium_world_button)
        large_world_button = Button(12, 15, 11, 2, f'Large [2048x2048]',
                                    lambda: Game.start_new_game(2048))
        large_world_button.activate()
        self.nodes.append(large_world_button)
        # huge_world_button = Button(12, 15, 11, 2, f'Huge [4096x4096]',
        #                            lambda: Game.start_new_game(4096))
        # huge_world_button.activate()
        # self.nodes.append(huge_world_button)

        # return button
        return_button = Button(13, 18, 9, 2, 'Return',
                               lambda: Game.set_app_state(AppStates.MAIN_MENU))
        return_button.activate()
        self.nodes.append(return_button)
コード例 #4
0
ファイル: load_game_view.py プロジェクト: matszach/wildrealm
    def initiate(self):
        from src.game_core_module.game import Game

        # load state buttons
        load_button_1 = Button(12, 6, 11, 2, f'Save state 1',
                               lambda: Game.load_game(1))
        if Game.load_file_exists(1):
            load_button_1.activate()
        self.nodes.append(load_button_1)
        load_button_2 = Button(12, 9, 11, 2, f'Save state 2',
                               lambda: Game.load_game(2))
        if Game.load_file_exists(2):
            load_button_2.activate()
        self.nodes.append(load_button_2)
        load_button_3 = Button(12, 12, 11, 2, f'Save state 3',
                               lambda: Game.load_game(3))
        if Game.load_file_exists(3):
            load_button_3.activate()
        self.nodes.append(load_button_3)
        load_button_4 = Button(12, 15, 11, 2, f'Save state 4',
                               lambda: Game.load_game(4))
        if Game.load_file_exists(4):
            load_button_4.activate()
        self.nodes.append(load_button_4)

        # return button
        return_button = Button(13, 18, 9, 2, 'Return',
                               lambda: Game.set_app_state(AppStates.MAIN_MENU))
        return_button.activate()
        self.nodes.append(return_button)
コード例 #5
0
    def initiate(self):
        from src.game_core_module.game import Game

        self.nodes.append(InGameMenuPanel(8.5, 11.5))

        self.nodes.append(BigText(13, 9.5, 9, 2, 'ARE YOU'))
        self.nodes.append(BigText(13, 11, 9, 2, 'SURE ?'))

        # yes button
        yes_button = Button(12, 14, 11, 2, 'Yes', lambda: Game.set_app_state(AppStates.MAIN_MENU))
        yes_button.activate()
        self.nodes.append(yes_button)

        # no button
        no_button = Button(12, 17, 11, 2, 'No', lambda: Game.set_app_state(AppStates.IN_GAME_PAUSED))
        no_button.activate()
        self.nodes.append(no_button)
コード例 #6
0
    def initiate(self):
        from src.game_core_module.game import Game

        # return button
        about_button = Button(13, 18, 9, 2, 'Return',
                              lambda: Game.set_app_state(AppStates.MAIN_MENU))
        about_button.activate()
        self.nodes.append(about_button)
コード例 #7
0
    def initiate(self):
        from src.game_core_module.game import Game

        self.nodes.append(BigText(13, 15, 9, 2, '[DEFAULT VIEW]'))

        about_button = Button(13, 18, 9, 2, 'To menu ...',
                              lambda: Game.set_app_state(AppStates.MAIN_MENU))
        about_button.activate()
        self.nodes.append(about_button)
コード例 #8
0
ファイル: save_game_view.py プロジェクト: matszach/wildrealm
    def initiate(self):
        from src.game_core_module.game import Game

        self.nodes.append(InGameMenuPanel(1, 19))

        self.nodes.append(BigText(13, 2, 9, 2, 'SAVE YOUR GAME'))

        # save buttons
        save_button_1 = Button(12, 5, 11, 2, '[Empty]',
                               lambda: Game.save_game(1))
        if Game.load_file_exists(1):
            save_button_1.text = f'Saved state 1'
        save_button_1.activate()
        self.nodes.append(save_button_1)

        save_button_2 = Button(12, 8, 11, 2, '[Empty]',
                               lambda: Game.save_game(2))
        if Game.load_file_exists(2):
            save_button_2.text = f'Saved state 2'
        save_button_2.activate()
        self.nodes.append(save_button_2)

        save_button_3 = Button(12, 11, 11, 2, '[Empty]',
                               lambda: Game.save_game(3))
        if Game.load_file_exists(3):
            save_button_3.text = f'Saved state 3'
        save_button_3.activate()
        self.nodes.append(save_button_3)

        save_button_4 = Button(12, 14, 11, 2, '[Empty]',
                               lambda: Game.save_game(4))
        if Game.load_file_exists(4):
            save_button_4.text = f'Saved state 4'
        save_button_4.activate()
        self.nodes.append(save_button_4)

        # return button
        return_button = Button(
            13, 17, 9, 2, 'Return',
            lambda: Game.set_app_state(AppStates.IN_GAME_PAUSED))
        return_button.activate()
        self.nodes.append(return_button)