def debug_wrapper(): # initialize things pygame.init() pose_source = user_pose.FPS_Pose(two_d=True) # initialize position source visar_controller = controller.Controller( pose_source) # initialize controller renderer = rendering.Renderer(visar_controller) # initialize renderer # add pose source to update stack visar_controller.add_update(pose_source.update) # setup a static square object (from rendertest) square1 = Debug_Static() # create a render module renderer.add_module(square1) # add module to render stack # setup dynamic (moving) square object (rendertest) square2 = Debug_Dynamic() # create another module visar_controller.add_update(square2.update) # add pose listener renderer.add_module(square2) # add drawable to render stack # setup a static square object with depth (from rendertest) square3 = Debug_Depth() # create a render module renderer.add_module(square3) # add module to render stack # run the controller (spawns new thread) #visar_controller.do_loop() # removed unused code # run the renderer (blocks until code is done) renderer.do_loop(visar_controller.kill_flag) # program quit, kill pygame pygame.quit()
def __init__(self, sequences, start, input): self.sequences = sequences self.input = input self.current = self.sequences[start](self.input) self.renderer = rendering.Renderer() self.timer = pygame.time.Clock() telemetry.log('Starting.') self.inactive_start = 0 self.refresh = 0
def visar(): debug_mode = False if len(sys.argv) > 1: if sys.argv[1] == '--debug': debug_mode = True # check for debug mode # initialize things pygame.init() pose_source = user_pose.FPS_Pose() # initialize position source visar_controller = controller.Controller( pose_source) # initialize controller renderer = rendering.Renderer(visar_controller, debug_mode) # initialize renderer # arrows arrows_ = arrows.Arrows() renderer.add_module(arrows_) # communications pop up comm_pu = comms_pop_up.Pop_Up() renderer.add_module(comm_pu) # menu buttons menu = menu_button.Menu() renderer.add_module(menu) # add pose source to update stack visar_controller.add_update(pose_source.update) visar_controller.add_update(menu.update) visar_controller.add_update(arrows_.update) visar_controller.add_update(comm_pu.update) # setup/start the audio manager (voice communication) audio_controller = audio.Audio_Manager(visar_controller) audio_controller.start_server_thread() visar_controller.book.audio_manager = audio_controller # start the controller (new thread) #visar_controller.do_loop() #temporarily disabled # run the renderer (same thread) renderer.do_loop(visar_controller.kill_flag) # cleanup print 'Shutting Down' audio_controller.cleanup() pygame.quit() # shutdown pygame
def __init__(self, enable_render=True): super(BabaEnv, self).__init__() self.path = '../../../Resources/Maps/volcano.txt' self.game = pyBaba.Game(self.path) self.renderer = rendering.Renderer(self.game) self.action_space = [ pyBaba.Direction.UP, pyBaba.Direction.DOWN, pyBaba.Direction.LEFT, pyBaba.Direction.RIGHT ] self.action_size = len(self.action_space) self.seed() self.reset()
def CARAS(): type = "PTRAIN" if(typeSwitcher(type) == ""): print("ERROR: Invalid type: {}".format(type)) sys.exit(0) frames = 20 numAnims = 1000 # Use this to vary the name of the images we want to create index_name = "CaffeImage" sc.clearPickleIndex(type, index_name) sc.clearIndex(index_name) for i in range(numAnims): #need a delimiter to separate scene# from frame# delim = "D" name = index_name + str(i) + delim #bugfix sc.secondAnimation(name, type, index_name) # sc.createBasicAnimation(name, 0) renderer = r.Renderer(frames=None) renderer.renderByName(name, type) renderer.appendImages(name, type) print("Completed Anim rendering")