本文整理汇总了Python中stage.Stage.new_turn方法的典型用法代码示例。如果您正苦于以下问题:Python Stage.new_turn方法的具体用法?Python Stage.new_turn怎么用?Python Stage.new_turn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stage.Stage
的用法示例。
在下文中一共展示了Stage.new_turn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Stage
# 需要导入模块: from stage import Stage [as 别名]
# 或者: from stage.Stage import new_turn [as 别名]
MAP_HEIGHT = m.h
stage = Stage(m, TILE_WIDTH, TILE_HEIGHT)
stage.add_child(p)
fontsheet = Fontsheet(os.path.join("tiles", "consolas_unicode_16x16.png"), TILE_WIDTH, TILE_HEIGHT)
if __name__ == '__main__':
screen = pygame.display.set_mode((400,400))
screen.fill(pygame.Color(255, 255, 255, 0))
area = get_area_around_entity(p, VIEW_SIZE, VIEW_SIZE, MAP_WIDTH, MAP_HEIGHT)
stage.render(area, screen, fontsheet)
pygame.display.update()
while 1:
#for e in pygame.event.get():
stage.new_turn()
while stage.check_turn():
e = pygame.event.wait()
if e.type == pygame.QUIT:
sys.exit()
elif e.type == pygame.KEYDOWN:
if e.key == pygame.K_t:
state = STATE_TARGETTING
print 'Entering targetting state. '
elif e.key == pygame.K_ESCAPE:
if state <> STATE_MOVEMENT:
state = STATE_MOVEMENT
print 'Entering movement state. '
try:
stage.remove_overlay(cursor)
cursor = None