本文整理汇总了Python中Engine.update方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.update方法的具体用法?Python Engine.update怎么用?Python Engine.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Engine
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import update [as 别名]
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)
b.update()
b.draw([0, 0])
#chars.sort(key=lambda x: (x.pos[1], x.pos[0]))
montag.update(current_time)
montag.draw()
pygame.display.update()
示例2: Engine
# 需要导入模块: import Engine [as 别名]
# 或者: from Engine import update [as 别名]
from Engine import *
# GBC: 160 x 144, level1: 480x256
engine = Engine((480, 256), 60)
while True:
engine.update()