本文整理汇总了Python中Engine.load_obstaclemap方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.load_obstaclemap方法的具体用法?Python Engine.load_obstaclemap怎么用?Python Engine.load_obstaclemap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.load_obstaclemap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import load_obstaclemap [as 别名]
self.frame = 0
elif self.movement_state == "waypoints":
if len(self.remaining_waypoints) == 0:
self.remaining_waypoints = self.waypoints.copy()
self.walk_to_points = [self.remaining_waypoints.pop(0)]
super().update(current_time, event)
if __name__ == "__main__":
pygame.init()
clock = pygame.time.Clock()
screen_info = pygame.display.Info()
screen_size = [screen_info.current_w, screen_info.current_h]
screen = pygame.display.set_mode(screen_size, RESIZABLE)
chars = []
b = Engine(screen)
b.load_tilemap("TheMap/map.floor", 0)
b.load_obstaclemap("TheMap/map.obstacles", 0)
montag = AICharacter(screen, "graphics/droids/blue_guard/atlas.txt", "graphics/droids/red_guard/config.txt", pathfinding_grid=b.obstacles.grid, pos=[3, 0], movement_state="random_walk", area=[5, 0, 10, 5])
while True:
current_time = pygame.time.get_ticks()
clock.tick(60)
screen.fill((0, 0, 0))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == VIDEORESIZE:
screen_size = event.dict["size"]
screen = pygame.display.set_mode(screen_size, RESIZABLE)
else:
montag.update(current_time, event)