2009-02-17 77 views

回答

0

它是如此簡單:

粒子系統*發射極= [ParticleExplosion節點]; [self addChild:emitter];

+1

我是否把它放在init中?它說它沒有聲明。有更詳細的解釋嗎? – VagueExplanation 2011-06-14 17:05:35

2

如果您在Xcode中打開Cocos2d源代碼,您應該能夠啓動包含所有粒子效果的ParticleTest示例。或者,搜索YouTube上的cocos2d,有一個演示視頻,顯示所有這些效果。

2
CCParticleSystem *emitter = [CCParticleExplosion node]; 

    //set the location of the emitter 
    emitter.position = mySprite.position; 

    //set size of particle animation 
    emitter.scale = 0.5; 

    //set an Image for the particle 
    emitter.texture = [[CCTextureCache sharedTextureCache] addImage:@"particle.png"]; 

    //set length of particle animation 
    [emitter setLife:0.5f]; 

    //add to layer ofcourse(effect begins after this step) 
    [self addChild: emitter]; 
相關問題