なぜ機能しないのかわかりません。パーティクルエフェクトは、衝突した部分ではなく、画面左下にあります。
.H ファイル内
CCParticleExplosion *starsExplosion;
.M ファイル内 衝突下
if(distance < 30) {
starsCollected += 100;
[_stars removeObject:stars];
//Stars Explosion
//starsExplosion.position = ccp(stars.contentSize.width, stars.contentSize.height);
starsExplosion = [[CCParticleExplosion alloc] init];
starsExplosion.position = ccp(stars.position.y, stars.position.x);
starsExplosion.texture = [[CCTextureCache sharedTextureCache] addImage:@"star-icon.png"];
[self addChild:starsExplosion];
[self removeChild:stars cleanup:YES];
}
と を使ってみましたが、うまくContentSize.Width
いきheight =
ませんでした。使っPosition.x
てみてy =
、また運も。