本文整理匯總了Python中Scene.Scene.addObjects方法的典型用法代碼示例。如果您正苦於以下問題:Python Scene.addObjects方法的具體用法?Python Scene.addObjects怎麽用?Python Scene.addObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Scene.Scene
的用法示例。
在下文中一共展示了Scene.addObjects方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DynamicDrawableObject
# 需要導入模塊: from Scene import Scene [as 別名]
# 或者: from Scene.Scene import addObjects [as 別名]
[pygame.image.load("%sa2/5%s"%("IndividualFrames/bmp16/",".bmp"))],
[pygame.image.load("%sa2/6%s"%("IndividualFrames/bmp16/",".bmp"))],
[pygame.image.load("%sa2/7%s"%("IndividualFrames/bmp16/",".bmp"))],
[pygame.image.load("%sa2/8%s"%("IndividualFrames/bmp16/",".bmp"))],
[pygame.image.load("%sa2/9%s"%("IndividualFrames/bmp16/",".bmp"))]
]
dynamicObj = DynamicDrawableObject(switch1,'',1,39,3, 2, 2)
secondDynamicObj = DynamicDrawableObject(switch1,'',1,39,100, 3, 3)
staticObj = DynamicDrawableObject(switch2,'',1,40,43, 4, 4)
initialList = [dynamicObj, secondDynamicObj]
secondaryList = [staticObj]
myScene = Scene(initialList)
myScene.addObjects(secondaryList)
myScene.nextFrame()
blitAndFlip()
time.sleep(2)
myScene.getObject(1).scale(100, 100)
myScene.getObject(1).nextFrame()
myScene.getObject(0).nextFrame()
myScene.getObject(2).nextFrame()
blitAndFlip()
time.sleep(2)
myScene.getObject(1).rotate(45)
myScene.getObject(1).nextFrame()
myScene.getObject(0).nextFrame()
myScene.getObject(2).nextFrame()
blitAndFlip()