def run(self): placer = Placer(NEW, NR_OLD_ONES, from_nr) if SHOW: graphics = Graphics(placer) graphics.display() while True: pass else: placer.run()
def run(self, actual_map, size): final_path = [self.start] graphics = Graphics(actual_map, self.start, self.goal, size=size) graphics.display(final_path, self.obstacles) path = self.init_path() if path == None: return None curr = self.get(self.start) while curr.loc != self.goal: self.change_map(actual_map, curr) path = self.navigate_map(curr) if path == None: return None curr = self.get(path[1]) final_path.append(path[1]) graphics.display(final_path, self.obstacles) graphics.display(final_path, self.obstacles, done=True) return final_path
elif event.type == pygame.QUIT: sys.exit() #=============================================================================================== #draw calls loc = dungeon.loc(pc) dungeon.draw( loc ) selection.draw() for each in update_list: each.draw( each.loc, None ) if not each.update( pygame.time.get_ticks() ): update_list.remove(each) gfx.display() pygame.display.flip() #=============================================================================================== # textureData = pygame.image.tostring(screen, "RGBA", 1) # width = screen.get_width() # height = screen.get_height() # texture = glGenTextures(1) # glBindTexture(GL_TEXTURE_2D, texture) # glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) # glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) # glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,width,height,0,GL_RGBA,GL_UNSIGNED_BYTE,textureData)
elif event.type == pygame.QUIT: sys.exit() #=============================================================================================== #draw calls loc = dungeon.loc(pc) dungeon.draw(loc) selection.draw() for each in update_list: each.draw(each.loc, None) if not each.update(pygame.time.get_ticks()): update_list.remove(each) gfx.display() pygame.display.flip() #=============================================================================================== # textureData = pygame.image.tostring(screen, "RGBA", 1) # width = screen.get_width() # height = screen.get_height() # texture = glGenTextures(1) # glBindTexture(GL_TEXTURE_2D, texture) # glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) # glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) # glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,width,height,0,GL_RGBA,GL_UNSIGNED_BYTE,textureData)