2009-02-17 59 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]; 
相关问题