当前位置: 首页>>代码示例>>Python>>正文


Python ParticleEffect.attachNewNode方法代码示例

本文整理汇总了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):
开发者ID:CarlosPlusPlus,项目名称:rpi-undergrad,代码行数:70,代码来源:LVL03.py


注:本文中的direct.particles.ParticleEffect.ParticleEffect.attachNewNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。