本文整理汇总了Python中direct.particles.ParticleEffect.ParticleEffect.attachNewNode方法的典型用法代码示例。如果您正苦于以下问题:Python ParticleEffect.attachNewNode方法的具体用法?Python ParticleEffect.attachNewNode怎么用?Python ParticleEffect.attachNewNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类direct.particles.ParticleEffect.ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.attachNewNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Lvl03
# 需要导入模块: from direct.particles.ParticleEffect import ParticleEffect [as 别名]
# 或者: from direct.particles.ParticleEffect.ParticleEffect import attachNewNode [as 别名]
#.........这里部分代码省略.........
self.ladder2.setScale(1.5)
self.ladder2.setPos(x1-4.9,0,h-20)
if j == 2:
self.ladder = loader.loadModel("models/gamedev/ladder")
self.ladder.reparentTo(render)
self.ladder.setScale(1.5)
self.ladder.setPos(m1-4.9,0,h-20)
self.ladder2 = loader.loadModel("models/gamedev/ladder")
self.ladder2.reparentTo(render)
self.ladder2.setScale(1.5)
self.ladder2.setPos(m2+4.9,0,h-20)
'''
self.first = 1
for i in range(r):
'''Right half of stage'''
self.environment = loader.loadModel("models/gamedev/platform")
self.environment.reparentTo(render)
self.environment.setScale(5)
self.environment.setPos(x1,0,h)
if self.first == 1:
self.first = 0
bounds = self.environment.getChild(0).getBounds()
center = bounds.getCenter()
poly1 = Point3(center.getX()+1, center.getY()-.5, center.getZ()+.2)
poly2 = Point3(center.getX()-(2*r-1), center.getY()-.5, center.getZ()+.2)
poly3 = Point3(center.getX()+1, center.getY()+.5, center.getZ()+.2)
poly4 = Point3(center.getX()-(2*r-1), center.getY()+.5, center.getZ()+.2)
cPoly = CollisionPolygon(poly4, poly2, poly1, poly3)
cNode = CollisionNode("platform")
cNode.addSolid(cPoly)
cNodePath = self.environment.attachNewNode(cNode)
cNodePath.show()
x1 = x1 - len
self.first = 1
for i in range(l):
'''Left Half of stage'''
self.environment = loader.loadModel("models/gamedev/platform")
self.environment.reparentTo(render)
self.environment.setScale(5)
self.environment.setPos(x2,0,h)
if self.first == 1:
self.first = 0
bounds = self.environment.getChild(0).getBounds()
center = bounds.getCenter()
poly1 = Point3(center.getX()+(2*l-1), center.getY()-.5, center.getZ()+.2)
poly2 = Point3(center.getX()-1, center.getY()-.5, center.getZ()+.2)
poly3 = Point3(center.getX()+(2*l-1), center.getY()+.5, center.getZ()+.2)
poly4 = Point3(center.getX()-1, center.getY()+.5, center.getZ()+.2)
cPoly = CollisionPolygon(poly4, poly2, poly1, poly3)
cNode = CollisionNode("platform")
cNode.addSolid(cPoly)
cNodePath = self.environment.attachNewNode(cNode)
cNodePath.show()
x2 = x2 + len
self.first = 1
for i in range(c1):