本文整理汇总了Python中level.Level.illuminated方法的典型用法代码示例。如果您正苦于以下问题:Python Level.illuminated方法的具体用法?Python Level.illuminated怎么用?Python Level.illuminated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类level.Level
的用法示例。
在下文中一共展示了Level.illuminated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_shop
# 需要导入模块: from level import Level [as 别名]
# 或者: from level.Level import illuminated [as 别名]
def generate_shop(w, h, shop_items):
level = Level(w, h, is_shop=True)
for x,y in range2d(w, h):
t = level.tiles[x][y]
if x == 0 or y == 0 or x == w-1 or y == h-1:
t.img = spr.WOOD_WALL
t.blocking = True
t.transparent = False
else:
t.img = spr.WOOD_FLOOR
t.blocking = False
t.transparent = True
for a,b in box2d(2, 2, 5, 5):
level.add_item((a,b), random.choice(shop_items))
for a,b in box2d(9, 2, 5, 5):
level.add_item((a,b), random.choice(shop_items))
for a,b in box2d(2, 9, 5, 5):
level.add_item((a,b), random.choice(shop_items))
for a,b in box2d(9, 9, 5, 5):
level.add_item((a,b), random.choice(shop_items))
level.illuminated = True
return level
示例2: Level
# 需要导入模块: from level import Level [as 别名]
# 或者: from level.Level import illuminated [as 别名]
import sprites as spr
from my_geom import box2d
from level import Level
from level_generators import generate_dungeon, generate_shop
from objects import Item, Portal
import default_items
import item_actions
WELL_DEPTH = 20
town = Level(25, 25, name="town")
well = [generate_dungeon(13+min(12,i), 13+min(12,i), i+1) for i in xrange(100)]
shop = []
town.illuminated = True
town.generate_town()
town.add_item((12,12), Item(spr.WELL, name="well of doom", holdable=False))
default_items.general = [
Item(spr.TORCH, name="torch", value=20, luminosity=3),
Item(spr.LANTERN, name="lantern", value=800, luminosity=5),
Item(spr.POTION_RED, name="lesser health potion", value=15,
desc="In[v]oking it will heal 10 HP.",
action=item_actions.heal_target(10),
),
Item(spr.SCROLL, name="town portal scroll", value=50,
desc="In[v]oking it will return the user to town after channeling.",
action=item_actions.tp_target_to(town, 12, 12),
),
Item(spr.ESSENCE, name="luminescent sphere", value=4000, luminosity=999),