當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。