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


Python Wizard.health方法代码示例

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


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

示例1: sigil_deserialize

# 需要导入模块: from wizard import Wizard [as 别名]
# 或者: from wizard.Wizard import health [as 别名]
            elif command == "CLAIMED":
                claimed = sprite_uuid_map[split_input[2]]
                if split_input[1] == client_networking.client_uuid:
                    # this means we got it
                    claimed.execute_claim(player)
                else:
                    # this means we didn't
                    claimed.execute_claim(opponent)
            elif command == "COMPLETE":
                print "Cast of", sigil_deserialize(split_input[1]).name, "complete"
            elif command == "REMOVE":
                print "Removing sigil", split_input[1]
                sprite_uuid_map[split_input[1]].remove()
            elif command == "HEALTH":
                if split_input[1] == client_networking.client_uuid:
                    player.health = int(split_input[2])
                else:
                    opponent.health = int(split_input[2])
        # every 3 seconds we'll look for sigils off the screen and clean them up
        if sigil_appearance_count % 180 == 0:
            out_of_bounds = [s for s in game_state.available_sprites if s.rect.x <= -150]
            for sigil in out_of_bounds:
                game_state.available_sprites.remove(sigil)
        sigil_appearance_count += 1

        # update all sprites and draw the UI, also keep the framerate synced
        game_state.all_sprites.update()
        game_state.sigil_overlay_sprites.update()
        screen.blit(generate_ui(), (0, 0))
        game_state.all_sprites.draw(screen)
        game_state.sigil_overlay_sprites.draw(screen)
开发者ID:maxburkhardt,项目名称:wizard-game,代码行数:33,代码来源:game.py


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