function YQWBaseGameScene:showGoodLuckEffect(drawIndex)
if not drawIndex then return end
local nodeRoot = self:getNodeGoodLuckShow()
if nodeRoot then
local goodLuckNode = cc.CSLoader:createNode("res/gamecocosstudio/csb/ani_others/ani_goodluck.csb")
if goodLuckNode then
nodeRoot:addChild(goodLuckNode)local goodLuckAni = cc.CSLoader:createTimeline("res/gamecocosstudio/csb/ani_others/ani_goodluck.csb")
if goodLuckAni then
local starAni = goodLuckNode:getChildByName("animation_star")
if starAni then
starAni:setVisible(false)
end
goodLuckNode:runAction(goodLuckAni)goodLuckAni:gotoFrameAndPlay(0, 101, false)
local function frameCallFunc(frame)
if frame and "Play_Particle" == frame:getEvent() then
local dstPlayer = self:getNodePlayer(drawIndex)
if not dstPlayer then return end
if starAni then
starAni:setVisible(true)
end
local aniMoveTo = cc.MoveTo:create(1, nodeRoot:convertToNodeSpace(cc.p(dstPlayer:getPosition())))
local scale = cc.ScaleTo:create(0.8, 0.1)
local action = cc.Spawn:create(aniMoveTo, scale)
goodLuckNode:runAction(action) --cc.Sequence:create(aniMoveTo, fadeOut)
elseif frame and "Play_Star" == frame:getEvent() then
if starAni then
starAni:setVisible(false)
end
elseif frame and "Play_Over" == frame:getEvent() then
goodLuckAni:clearFrameEventCallFunc()
goodLuckNode:setVisible(false)
goodLuckNode:getParent():removeChild(goodLuckNode, true)
goodLuckNode = nil
if gameController then
gameController:finishedGoodLuckAni()
end
end
end
goodLuckAni:setFrameEventCallFunc(frameCallFunc)
end
end
end
end
local emitter1 = cc.ParticleExplosion:createWithTotalParticles(130)
-- local emitter1 = cc.ParticleSun:createWithTotalParticles(60)
emitter1:setAutoRemoveOnFinish(true)
emitter1:setPosition(dstPlayer:convertToNodeSpace(cc.p(dstPlayer:getPosition())))
emitter1:setTexture(cc.Director:getInstance():getTextureCache():addImage("res/gamecocosstudio/plist/animation/pplz.png")) --加载图片
dstPlayer:addChild(emitter1, 100)
emitter1:setLife(0.1)
local dstPlayer = self:getNodePlayer(drawIndex)
local emitter1 = cc.ParticleSystemQuad:create("res/gamecocosstudio/plist/animation/bglz.plist")--加载粒子动画
emitter1:setAutoRemoveOnFinish(true)
emitter1:setPosition(cc.p(dstPlayer:getPosition()))
dstPlayer:addChild(emitter1, 100)
emitter1:setDuration(0.5)