本文整理汇总了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)