本文整理匯總了Python中stage.Stage.check_turn方法的典型用法代碼示例。如果您正苦於以下問題:Python Stage.check_turn方法的具體用法?Python Stage.check_turn怎麽用?Python Stage.check_turn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類stage.Stage
的用法示例。
在下文中一共展示了Stage.check_turn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Stage
# 需要導入模塊: from stage import Stage [as 別名]
# 或者: from stage.Stage import check_turn [as 別名]
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
except: