void OnTouchesEnded(List <CCTouch> touches, CCEvent touchEvent) { var monstersToDelete = new List <CCNode>(); var touch = touches[0]; var touchLocation = Layer.ScreenToWorldspace(touch.LocationOnScreen); foreach (var monster in _monstersOnScreen) { if (monster.BoundingBox.ContainsPoint(touchLocation)) { monstersToDelete.Add(monster); var m = _monsters[monster.Tag]; var splashPool = new CCSprite(m.SplashSprite); if (m.KillMethod == 1) { splashPool.Position = monster.Position; AddChild(splashPool); var fade = new CCFadeOut(3.0f); var remove = new CCCallFuncN(RemoveSprite); var sequencia = new CCSequence(fade, remove); CCSimpleAudioEngine.SharedEngine.EffectsVolume = 0.7f; CCSimpleAudioEngine.SharedEngine.PlayEffect("Sounds/SplatEffect"); splashPool.RunAction(sequencia); } else if (m.KillMethod == 2) { CCSimpleAudioEngine.SharedEngine.EffectsVolume = 1.0f; CCSimpleAudioEngine.SharedEngine.PlayEffect("Sounds/pew-pew-lei"); splashPool.Position = monster.Position; AddChild(splashPool); var fade = new CCFadeOut(3.0f); var particleEmitter = new CCCallFuncND(StartExplosion, monster); var sequencia = new CCSequence(particleEmitter, fade); CCSimpleAudioEngine.SharedEngine.EffectsVolume = 0.7f; CCSimpleAudioEngine.SharedEngine.PlayEffect("Sounds/SplatEffect"); splashPool.RunAction(sequencia); } break; } } foreach (var monster in monstersToDelete) { monster.StopAllActions(); _monstersOnScreen.Remove(monster); RemoveChild(monster); } }
public override void onEnter() { base.onEnter(); alignSpritesLeft(1); m_grossini.visible = false; CCFiniteTimeAction action = CCSequence.actions( CCPlace.actionWithPosition(new CCPoint(200, 200)), CCShow.action(), CCMoveBy.actionWithDuration(1, new CCPoint(100, 0)), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(callback1)), CCCallFuncN.actionWithTarget(this, new SEL_CallFuncN(callback2)), CCCallFuncND.actionWithTarget(this, new SEL_CallFuncND(callback3), (object)0xbebabeba)); m_grossini.runAction(action); }
public override void onEnter() { base.onEnter(); centerSprites(3); CCFiniteTimeAction action = CCSequence.actions( CCMoveBy.actionWithDuration(2, new CCPoint(200, 0)), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(callback1))); CCFiniteTimeAction action2 = CCSequence.actions( CCScaleBy.actionWithDuration(2, 2), CCFadeOut.actionWithDuration(2), CCCallFuncN.actionWithTarget(this, new SEL_CallFuncN(callback2))); CCFiniteTimeAction action3 = CCSequence.actions( CCRotateBy.actionWithDuration(3, 360), CCFadeOut.actionWithDuration(2), CCCallFuncND.actionWithTarget(this, new SEL_CallFuncND(callback3), (object)0xbebabeba)); m_grossini.runAction(action); m_tamara.runAction(action2); m_kathia.runAction(action3); }
public CCCallFuncND(CCCallFuncND callFuncND) : base(callFuncND) { InitWithTarget(callFuncND.m_pCallFuncND, callFuncND.m_pData); }