本文整理汇总了Python中level.Level.portals[(12,12)]方法的典型用法代码示例。如果您正苦于以下问题:Python Level.portals[(12,12)]方法的具体用法?Python Level.portals[(12,12)]怎么用?Python Level.portals[(12,12)]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类level.Level
的用法示例。
在下文中一共展示了Level.portals[(12,12)]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Portal
# 需要导入模块: from level import Level [as 别名]
# 或者: from level.Level import portals[(12,12)] [as 别名]
town.portals[(x,y)] = Portal(new_shop, 1, 1, name="the "+shop_name)
# add portal to town from shop
new_shop.add_item((1,1), Item(spr.DOOR, holdable=False))
new_shop.portals[(1,1)] = Portal(town, x, y, name="the town")
# Add portals to dungeon
for i in xrange(WELL_DEPTH):
mr = well[i].get_main_region()
to_up, to_down = random.sample(mr, 2)
if i == 0:
well[i].add_item(to_up, Item(spr.ROPE_UP, holdable=False))
well[i].add_item(to_down, Item(spr.WELL, holdable=False))
well[i].portals[to_up] = Portal(town, 12, 12)
town.portals[(12,12)] = Portal(well[0], *to_up, name="the well of doom")
elif i == WELL_DEPTH-1:
well[i].add_item(to_up, Item(spr.ROPE_UP, holdable=False))
well[i].add_item(to_down, Item(spr.TRIFORCE, name="triforce", value=0, luminosity=8, equippable=True,
attr={
'attack_damage': (50,200),
'attack_haste': 0.4,
'movement_haste': 0.4,
'health': 9001,
}),
)
well[i-1].portals[prev_down] = Portal(well[i], *to_up, name="well level %d" % (i+1))
well[i].portals[to_up] = Portal(well[i-1], *prev_down, name="well level %d" % i)
else:
well[i].add_item(to_up, Item(spr.ROPE_UP, holdable=False))
well[i].add_item(to_down, Item(spr.WELL, holdable=False))