当前位置: 首页>>代码示例>>Python>>正文


Python Wizard.can_get_sigil方法代码示例

本文整理汇总了Python中wizard.Wizard.can_get_sigil方法的典型用法代码示例。如果您正苦于以下问题:Python Wizard.can_get_sigil方法的具体用法?Python Wizard.can_get_sigil怎么用?Python Wizard.can_get_sigil使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wizard.Wizard的用法示例。


在下文中一共展示了Wizard.can_get_sigil方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: or

# 需要导入模块: from wizard import Wizard [as 别名]
# 或者: from wizard.Wizard import can_get_sigil [as 别名]
        # event handling
        for event in pygame.event.get():
            if event.type == QUIT or (event.type == KEYDOWN and
                                              event.key == K_ESCAPE):
                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:
开发者ID:maxburkhardt,项目名称:wizard-game,代码行数:32,代码来源:game.py


注:本文中的wizard.Wizard.can_get_sigil方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。