本文整理汇总了Python中Map.Map.populate_with方法的典型用法代码示例。如果您正苦于以下问题:Python Map.populate_with方法的具体用法?Python Map.populate_with怎么用?Python Map.populate_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map.Map
的用法示例。
在下文中一共展示了Map.populate_with方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Rock
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import populate_with [as 别名]
hole = Rock("rabbithole", b * 5 + GR["rabbithole"]["w"], b * 5 - GR["rabbithole"]["h"], [0, 1 / 2, 1, 1 / 2])
jmyman = Rock("jeremy0", b * 5 + GR["rabbithole"]["w"], b * 5 - GR["rabbithole"]["h"], [0, 3 / 4, 1, 1 / 4])
jmyman.background_range = hole.background_range.copy()
dancelionanim = Animation(["dancelion0", "dancelion1"], (60000/130)*2)
dancelion = Rock(dancelionanim, b/2, b * 4, [0, 3 / 4, 1, 1 / 4])
dancelion.updatealways = True
jeremyhome = Map(rgrassland, [hole,
jmyman,
dancelion])
dontputrockslist = [dancelion.getrect(), jmyman.getrect()]
jeremyhome.populate_with("greyrock", randint(0, 2), dontputrockslist)
jeremyhome.populate_with("pinetree", randint(3, 8), dontputrockslist)
jeremyhome.populate_with("flower", randint(15, 25), dontputrockslist)
jeremyhome.exitareas = [Exit("right", False, 'outside1', "left", "same"),
Exit("left", False, 'snowentrance', "right", "same")]
jeremy = getconversation("jeremy")
jeremy.area = [b * 5 + GR["rabbithole"]["w"] - (honeyw / 2), b * 5 - GR["rabbithole"]["h"],
GR["rabbithole"]["w"] - (honeyw / 2), GR["rabbithole"]["h"]]
jeremy.eventrequirements = [EventRequirement("beatsteve", -1, 1)]
jeremyaftersteve = getconversation("jeremyaftersteve")
jeremyaftersteve.area = jeremy.area.copy()
jeremyaftersteve.eventrequirements = [EventRequirement("beatsteve")]
dancelionpass = getconversation("dancelionpass")
示例2: getconversation
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import populate_with [as 别名]
chimneybattlec.eventrequirements = [EventRequirement("chimneyactivation")]
chimneye = copy.copy(enemies.enemies["chimney"])
chimneye.lv = 7
chimneybattlec.special_battle = chimneye
beatchimneyc = getconversation("beatchimneyc")
makeconversationreward(beatchimneyc, chimneybattlec.special_battle, "chromatic")
outside1 = Map(rgrassland,
[houserock,
Rock(graphics.greyrock(), 6.5 * b, 7.5 * b, variables.ROCKCOLLIDESECTION),
treerock,
meangreenrock,
chimneyrock])
outside1.populate_with("pinetree", 4, [cleararearect])
outside1.populate_with("flower", randint(3, 7), [cleararearect])
outsidewidth = GR[rgrassland]["w"]
outsideheight = GR[rgrassland]["h"]
outside1.startpoint = [b * 8, b * 4]
outside1.exitareas = [Exit("right", False, 'outside2', "left", "same"),
Exit("left", False, 'jeremyhome', "right",
"same"),
Exit([housewidth * (1.5 / 5) + houserock.x, househeight * (3 / 5), housewidth * (1 / 10),
househeight * (1 / 5)],
True, 'honeyhome',
41, insideheight - honeyh)]
outside1.lvrange = [1, 2]
outside1c = getconversation("meaniestops")
示例3: Map
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import populate_with [as 别名]
from random import randint
import variables, graphics, enemies
from enemies import enemyforspecialbattle
from conversations import getconversation
from Map import Map
from graphics import snowland
from Exit import Exit
from Rock import Rock
from pygame import Rect
# snowentrance###########################################################################
snowentrance = Map(snowland(650, 500, True), [])
snowentrance.populate_with("snowpinetree", randint(4, 10))
snowentrance.exitareas = [Exit("right", False, "jeremyhome", "left", "same"),
Exit("left", False, "snowarea1", "right", "same")]
snowentrance.enemies = enemies.snowenemies
snowentrance.lvrange = [6]
# snowarea1##############################################################################
snowarea1 = Map(snowland(700, 500), [])
snowarea1.populate_with("snowpinetree", randint(10, 15))
snowarea1.lvrange = [6, 7]
snowarea1.enemies = enemies.snowenemies
snowarea1.exitareas = [Exit("right", False, "snowentrance", "left", "same"),
Exit("left", False, "hoppingtreearea", "right", "same")]