def click_play(self): self.end() self.empty() bck = Background('resources\\test_images\\white_background.png') World.add(bck) level = Level(self.gamestates, self.path.split('\\')[-1][:-4]) World.setup_level(level) World.add(self.gamestates.target_label) thread_lock.pause_main = False self.gamestates.state = self.gamestates.GAME Frame.default_coordinates = Coordinates(0, 0) if Borders.focus_object is None: Borders.gain_focus(World.main_character) Borders.lock() pygame.event.set_grab(Settings.mouse_confined) self.gamestates.sleep()
def click_build(self): self.empty() bck = Background('resources\\test_images\\white_background.png') World.add(bck) save_button = SaveButton() save_button.coordinates = Coordinates(650, 500) World.add(save_button) level = Level(self.gamestates, '') World.setup_level(level) thread_lock.pause_main = False self.gamestates.state = self.gamestates.BUILDER Frame.default_coordinates = Coordinates(0, 0) if Borders.focus_object is None: Borders.gain_focus(World.main_character) Borders.lock() pygame.event.set_grab(Settings.mouse_confined) self.gamestates.sleep()