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


Python ComponentManager.new_Component方法代码示例

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


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

示例1: New_Game

# 需要导入模块: from ComponentManager import ComponentManager [as 别名]
# 或者: from ComponentManager.ComponentManager import new_Component [as 别名]
def New_Game():
    get_name()
    ECS_Storage.init()
    CM.new_Component('Poison')
    config.DungeonLevelIds = {}
    config.CurrentDungeonLevel = 0
    config.PlayerId = EM.new_Id()
    config.PlayerAttack = EM.new_Id()
    config.fov_recompute = True
    config.game_msg = []
    config.game_state = 'playing'
    config.xptolevel = 66.6
    CM.new_Component('ToLevel')
    CM.add_Component(config.PlayerId, 'Tile', Tile('Player', '@', False,
                                                   True, Color.sky))
    CM.add_Component(config.PlayerId, 'Coord',
                     Coord(config.playscreen_width / 2,
                           config.playscreen_height / 2))
    deatheffects = [player_death]
    CM.add_Component(config.PlayerId, 'Death',
                     Death('You have died. What a pity.' +
                           ' Did you even manage to get any loot?',
                           '%', effects=deatheffects))
    CM.add_Component(config.PlayerId, 'Creature', Creature(10, 0, 10,
                                                           10, 7, 0,
                                                           special={}))
    CM.add_Component(config.PlayerId, 'Level', Level())
    CM.add_Component(config.PlayerAttack, 'Attack', Attack(1, 4))
    next_level()
    Message('Welcome young adventurer! You have just entered my dungeon and' +
            ' through my deal with the adventurers guild you may explore my' +
            ' first 12 levels! Though of course everything will still try to' +
            ' kill you but atleast once finish there is an easy passage out!',
            Color.red)
开发者ID:Akhier,项目名称:12Down,代码行数:36,代码来源:New_Game.py


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