public override void onEnter() { base.onEnter(); m_background.parent.removeChild(m_background, true); m_background = null; CCParallaxNode p = CCParallaxNode.node(); addChild(p, 5); CCSprite p1 = CCSprite.spriteWithFile(TestResource.s_back3); CCSprite p2 = CCSprite.spriteWithFile(TestResource.s_back3); p.addChild(p1, 1, new CCPoint(0.5f, 1), new CCPoint(0, 0)); p.addChild(p2, 2, new CCPoint(1.5f, 1), new CCPoint(0, 0)); m_emitter = CCParticleFlower.node(); m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire); p1.addChild(m_emitter, 10); m_emitter.position = new CCPoint(250, 200); CCParticleSun par = CCParticleSun.node(); p2.addChild(par, 10); par.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire); CCActionInterval move = CCMoveBy.actionWithDuration(4, new CCPoint(300, 0)); CCFiniteTimeAction move_back = move.reverse(); CCFiniteTimeAction seq = CCSequence.actions(move, move_back); p.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq)); }
public override void onEnter() { base.onEnter(); m_emitter = CCParticleFlower.node(); m_background.addChild(m_emitter, 10); m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_stars1); setEmitterPosition(); }
public override void onEnter() { base.onEnter(); m_emitter = CCParticleFlower.node(); m_background.addChild(m_emitter, 10); m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_stars1); m_emitter.LifeVar = 0; m_emitter.Life = 10; m_emitter.setSpeed(100); m_emitter.setSpeedVar(0); m_emitter.EmissionRate = 10000; setEmitterPosition(); }
public PointBubble(int xIndex, int yIndex, int listIndex, int pointValue, int tapsNeeded) : base(xIndex, yIndex, listIndex) { TapCount = 0; TapsToPop = tapsNeeded; PointValue = pointValue; XIndex = xIndex; YIndex = yIndex; ListIndex = listIndex; TimeDelay = CCRandom.GetRandomFloat(MIN_TIME_DELAY, MAX_TIME_DELAY); TimeAppear = CCRandom.GetRandomFloat(MIN_TIME_APPEAR, MAX_TIME_APPEAR); TimeHold = CCRandom.GetRandomFloat(MIN_TIME_HOLD, MAX_TIME_HOLD); TimeFade = CCRandom.GetRandomFloat(MIN_TIME_FADE, MAX_TIME_FADE); BubbleSpriteSheet = new CCSpriteSheet("bubbles.plist"); BubbleSprite = new CCSprite(BubbleSpriteSheet.Frames.Find(x => x.TextureFilename.Equals("bubble-std-iceblue.png"))); BubbleSprite.AnchorPoint = CCPoint.AnchorMiddle; BubbleSprite.Opacity = 0; AddChild(BubbleSprite); PointLabel = new CCLabel(pointValue.ToString(), "gothic-44-hd.fnt"); PointLabel.AnchorPoint = CCPoint.AnchorMiddle; PointLabel.Opacity = 0; AddChild(PointLabel); PopSprite = new CCSprite(BubbleSpriteSheet.Frames.Find(x => x.TextureFilename.Equals("bubble-pop-iceblue.png"))); PopSprite.AnchorPoint = CCPoint.AnchorMiddle; PopSprite.Scale = 0.0f; AddChild(PopSprite); Emitter = new CCParticleFlower(Position) { Texture = CCTextureCache.SharedTextureCache.AddImage("stars"), TotalParticles = 0, // start with total particles at zero then have it go to a higher number once the bubble sprite is visible }; }
public static new CCParticleFlower Create() { var ret = new CCParticleFlower(); ret.InitWithTotalParticles(250); return ret; }