本文整理汇总了Python中effect.Effect.sharedExplosion方法的典型用法代码示例。如果您正苦于以下问题:Python Effect.sharedExplosion方法的具体用法?Python Effect.sharedExplosion怎么用?Python Effect.sharedExplosion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类effect.Effect
的用法示例。
在下文中一共展示了Effect.sharedExplosion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _ui
# 需要导入模块: from effect import Effect [as 别名]
# 或者: from effect.Effect import sharedExplosion [as 别名]
def _ui(self):
self.isBackSkyReload = False
self.isBackTileReload = False
self.tempScore = 0
self.time = 0
self.init_cb()
self.state = statePlaying
Enemy.sharedEnemy()
Effect.sharedExplosion()
config.resetConfig()
self.levelManager = self.ctl.levelManager
self.levelManager.init(self)
#初始化背景
self.initBackground()
winSize = self.winSize
self.screenRec = CCRectMake(0, 0, winSize.width, winSize.height + 10)
# score
self.lbScore = CCLabelBMFont.create("Score:0", s_arial14_fnt)
self.lbScore.setAnchorPoint(1, 0)
self.lbScore.setAlignment(kCCTextAlignmentRight)
self.addChild(self.lbScore, 1000)
self.lbScore.setPosition(winSize.width - 5, winSize.height - 30)
# ship life
shipTexture = CCTextureCache.sharedTextureCache().addImage(s_ship01)
life = CCSprite.createWithTexture(shipTexture, CCRectMake(0, 0, 60, 38))
life.setScale(0.6)
life.setPosition(30, winSize.height-23)
self.addChild(life, 1, 5)
# ship life count
self.lifeCount = CCLabelTTF.create(str(config.life), "Arial", 20)
self.lifeCount.setPosition(60, winSize.height-20)
self.lifeCount.setColor(ccc3(255,0, 0))
self.addChild(self.lifeCount, 1000)
# ship
self.ship = None
self.init_ship()
pause = CCMenuItemImage.create("pause.png", "pause.png",
cb=self.cb_doPause)
pause.setAnchorPoint(1, 0)
pause.setPosition(winSize.width, 0)
menu = CCMenu.create(pause)
menu.setAnchorPoint(0, 0)
self.addChild(menu, 1, 10)
menu.setPosition1(CCPointZero)
# 调 update函数
# self.layer.scheduleUpdate()
self.ctl.schedule(self.cb_update, 1/80.0)
# 每秒调一次 scoreCounter函数
self.ctl.schedule(self.cb_scoreCounter, 1)
if config.isAudioOn:
self.ctl.audio.playBackgroundMusic(s_bgMusic, True)