Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 粒子引擎问题_Iphone_Cocos2d Iphone_Particles - Fatal编程技术网

Iphone 粒子引擎问题

Iphone 粒子引擎问题,iphone,cocos2d-iphone,particles,Iphone,Cocos2d Iphone,Particles,我正在实现粒子引擎,下面是我的代码: -(id) init { // always call "super" init // Apple recommends to re-assign "self" with the "super" return value if( (self=[super init] )) { self.isTouchEnabled = YES; emitter = [[CCParticleMeteor all

我正在实现粒子引擎,下面是我的代码:

-(id) init
{
    // always call "super" init
    // Apple recommends to re-assign "self" with the "super" return value
    if( (self=[super init] )) 
    {
        self.isTouchEnabled = YES;
        emitter = [[CCParticleMeteor alloc] init];
        emitter.texture     =   [[CCTextureCache sharedTextureCache] addImage:@"stars.png"];
        emitter.position    =   ccp( 240, 160 );
        [self addChild:emitter];

    }
    return self;
}
-(BOOL) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self ccTouchesMoved:touches withEvent:event];
    return YES;
}
-(BOOL) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *myTouch    =   [touches anyObject];
    CGPoint location    =   [myTouch locationInView:[myTouch view]];
    CGPoint point       =   [[CCDirector sharedDirector] convertToGL:location];
    emitter.position    =   ccp(point.x , point.y);
    return YES;
}
下面是屏幕截图:

这是我想要的:

1-我想改变效果的方向(意味着火焰向上移动,但我想向下移动)

我想改变火焰的颜色

如果可以,请提供帮助……

1)快速查看n可以为您提供角度或重力-尝试将它们设置为不同的值,即

emitter.angle = <the angle you want>
emitter.angle=
2) 将stars.png编辑为您想要的颜色?

1)快速查看n可以提供角度或重力-尝试将它们设置为不同的值,即

emitter.angle = <the angle you want>
emitter.angle=
2) 是否将stars.png编辑为您想要的颜色