本文整理汇总了Python中wizard.Wizard.clear_selection方法的典型用法代码示例。如果您正苦于以下问题:Python Wizard.clear_selection方法的具体用法?Python Wizard.clear_selection怎么用?Python Wizard.clear_selection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wizard.Wizard
的用法示例。
在下文中一共展示了Wizard.clear_selection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from wizard import Wizard [as 别名]
# 或者: from wizard.Wizard import clear_selection [as 别名]
running = False
break
elif event.type == KEYDOWN and event.key == K_LSHIFT:
combo_select = True
elif event.type == KEYUP and event.key == K_LSHIFT:
combo_select = False
elif event.type == MOUSEBUTTONUP:
pos = pygame.mouse.get_pos()
# handle clicking on available sigil
if player.can_get_sigil():
clicked_sprites = [s for s in game_state.available_sprites if
s.rect.collidepoint(pos)]
for sprite in clicked_sprites:
# we clear combo select if you click something else
player.clear_selection()
sprite.claim()
# handle clicking on a sigil in your spellbook
clicked_in_spellbook = [s for s in player.spellbook if
s.rect.collidepoint(pos)]
for sprite in clicked_in_spellbook:
# if we're not selecting spells for a combo, proceed as normal
if not combo_select:
# if the player clicks a non-combo sigil, cast it
if sprite not in player.combo_select:
# we clear combo select if you click something else
player.clear_selection()
sprite.cast()
# otherwise, cast the combo it's in
else: