Exemple #1
0
 def set_resolution(width, height):
     Config.set_resolution(width, height)
     SaveManager.set_entry('preferences', 'resolution', [width, height])
     GUI.clear()
     MainMenuGUI.init()
     MainMenuGUI.remove_buttons()
     SettingsGUI.init()
Exemple #2
0
 def load_scene(self):
     from scene_loader import load_scene
     GUI.del_element('house')
     SaveManager.set_entry('village1', 'plr_coord',
                           self._player.transform.coord)
     load_scene('scenes/house1.json')
     if SaveManager.get_entry('village1', 'seen_tardis'):
         SceneManager.current_scene.remove_object(
             SceneManager.current_scene.find_object('tardis'))
Exemple #3
0
    def update(self, *args):
        for event in InputManager.get_events():
            if event.type == pygame.KEYDOWN:
                if event.key not in list(InputManager.AXES['Horizontal']) + list(InputManager.AXES['Vertical']) or \
                        event.key == SaveManager.get_entry('preferences', self.name):

                    direction = 'Horizontal' if self.name in (
                        'left', 'right') else 'Vertical'

                    axis = InputManager.AXES[direction]
                    axis[event.key] = axis.pop(
                        SaveManager.get_entry('preferences', self.name))
                    InputManager.set_axis(direction, axis)

                    SaveManager.set_entry('preferences', self.name, event.key)
                    self.button.text = 'Move {}: {}'.format(
                        self.name,
                        pygame.key.name(
                            SaveManager.get_entry('preferences', self.name)))
                    SceneManager.current_scene.remove_object(self.game_object)
Exemple #4
0
 def toggle_fullscreen(value):
     SaveManager.set_entry('preferences', 'fullscreen', value)
     Config.set_fullscreen(value)
Exemple #5
0
 def set_icon(path):
     SaveManager.set_entry('config', 'icon', path)
     pygame.display.set_icon(pygame.image.load(path).convert_alpha())
Exemple #6
0
 def set_fullscreen(value):
     SaveManager.set_entry('config', 'fullscreen', value)
     pygame.display.set_mode(SaveManager.get_entry('config', 'resolution'),
                             Config.get_flags())
     return value
Exemple #7
0
 def set_height(height):
     SaveManager.set_entry('config', 'resolution',
                           [Config.get_width(), height])
Exemple #8
0
 def set_width(width):
     SaveManager.set_entry('config', 'resolution',
                           [width, Config.get_height()])
Exemple #9
0
 def set_resolution(width, height):
     SaveManager.set_entry('config', 'resolution', [width, height])
     pygame.display.set_mode((width, height), Config.get_flags())
     return width, height
Exemple #10
0
 def set_caption(text):
     SaveManager.set_entry('config', 'title', text)
     return text
Exemple #11
0
 def update(self, *args):
     SaveManager.set_entry('village1', 'seen_tardis', True)
     if time() - self._start_time > 3:
         SceneManager.current_scene.remove_object(self.game_object)
Exemple #12
0
 def load_scene(self):
     from scene_loader import load_scene
     GUI.del_element('house')
     SaveManager.set_entry('village1', 'plr_coord',
                           self._player.transform.coord)
     load_scene('scenes/house3.json')