Beispiel #1
0
    def destroy(self):
        self.stop()
        CCLOG("destroy one ship")
        config.updateLifeCount()
        CCLOG("life count is %d", config.life)

        Effect.explode(self.sprite.getParent(), self.sprite.getPosition())
        self.sprite.removeFromParent()
        
        if config.isAudioOn:
            self.ctl.audio.playEffect(s_shipDestroyEffect)
        self.view.unit_destroy(self)
Beispiel #2
0
    def destroy(self):
        self.stop()
        # 更新分数
        config.scoreValue += self.scoreValue

        # 爆炸特效和闪光特效
        Effect.explode(self.sprite.getParent(), self.sprite.getPosition())
        
        Effect.spark(self.sprite.getPosition(), self.sprite.getParent(), 1.2, 0.7)
        
        # 敌机爆炸,从敌机数组删除
        config.enemy_items.remove(self)
        # 删除精灵
        self.sprite.removeFromParent()
        
        # # 声音
        # if (Config.sharedConfig().getAudioState()) {
        #         SimpleAudioEngine.sharedEngine().playEffect(s_explodeEffect)
        # }
        self.view.unit_destroy(self)
Beispiel #3
0
    def destroy(self):
        self.stop()
        # 更新分数
        config.scoreValue += self.scoreValue

        # 爆炸特效和闪光特效
        Effect.explode(self.sprite.getParent(), self.sprite.getPosition())

        Effect.spark(self.sprite.getPosition(), self.sprite.getParent(), 1.2,
                     0.7)

        # 敌机爆炸,从敌机数组删除
        config.enemy_items.remove(self)
        # 删除精灵
        self.sprite.removeFromParent()

        # # 声音
        # if (Config.sharedConfig().getAudioState()) {
        #         SimpleAudioEngine.sharedEngine().playEffect(s_explodeEffect)
        # }
        self.view.unit_destroy(self)