public StressTest2() { CCSize s = CCDirector.SharedDirector.WinSize; CCLayer sublayer = new CCLayer(); CCSprite sp1 = new CCSprite(TestResource.s_pPathSister1); sp1.Position = (new CCPoint(80, s.Height / 2)); CCActionInterval move = new CCMoveBy(3, new CCPoint(350, 0)); CCActionInterval move_ease_inout3 = new CCEaseInOut((CCActionInterval)(move.Copy()), 2.0f); var move_ease_inout_back3 = (CCActionInterval)move_ease_inout3.Reverse(); CCFiniteTimeAction seq3 = CCSequence.FromActions(move_ease_inout3, move_ease_inout_back3); sp1.RunAction(new CCRepeatForever((CCActionInterval)seq3)); sublayer.AddChild(sp1, 1); CCParticleFire fire = new CCParticleFire(); fire.Texture = (CCTextureCache.SharedTextureCache.AddImage("Images/fire")); fire.Position = (new CCPoint(80, s.Height / 2 - 50)); var copy_seq3 = (CCActionInterval)(seq3.Copy()); fire.RunAction(new CCRepeatForever(copy_seq3)); sublayer.AddChild(fire, 2); Schedule((shouldNotLeak), 6.0f); AddChild(sublayer, 0, CocosNodeTestStaticLibrary.kTagSprite1); }
public StressTest2() { var sublayer = new CCLayer(); var sp1 = new CCSprite(TestResource.s_pPathSister1); var move = new CCMoveBy(3, new CCPoint(350, 0)); var move_ease_inout3 = new CCEaseInOut(move, 2.0f); var move_ease_inout_back3 = move_ease_inout3.Reverse(); var seq3 = new CCSequence(move_ease_inout3, move_ease_inout_back3); sp1.RepeatForever(seq3); sublayer.AddChild(sp1, 1, CocosNodeTestStaticLibrary.kTagSprite2); var fire = new CCParticleFire(CCPoint.Zero) { Tag = CocosNodeTestStaticLibrary.kTagSprite3 }; fire.Texture = (CCTextureCache.SharedTextureCache.AddImage("Images/fire")); fire.RepeatForever(seq3); sublayer.AddChild(fire, 2); Schedule(shouldNotLeak, 6.0f); AddChild(sublayer, 0, CocosNodeTestStaticLibrary.kTagSprite1); }
public StressTest2() { CCSize s = CCDirector.sharedDirector().getWinSize(); CCLayer sublayer = CCLayer.node(); CCSprite sp1 = CCSprite.spriteWithFile(TestResource.s_pPathSister1); sp1.position = (new CCPoint(80, s.height / 2)); CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(350, 0)); CCActionInterval move_ease_inout3 = CCEaseInOut.actionWithAction((CCActionInterval)(move.copy()), 2.0f); CCActionInterval move_ease_inout_back3 = (CCActionInterval)move_ease_inout3.reverse(); CCFiniteTimeAction seq3 = CCSequence.actions(move_ease_inout3, move_ease_inout_back3); sp1.runAction(CCRepeatForever.actionWithAction((CCActionInterval)seq3)); sublayer.addChild(sp1, 1); CCParticleFire fire = CCParticleFire.node(); fire.Texture = (CCTextureCache.sharedTextureCache().addImage("Images/fire")); fire.position = (new CCPoint(80, s.height / 2 - 50)); CCActionInterval copy_seq3 = (CCActionInterval)(seq3.copy()); fire.runAction(CCRepeatForever.actionWithAction(copy_seq3)); sublayer.addChild(fire, 2); schedule((shouldNotLeak), 6.0f); addChild(sublayer, 0, CocosNodeTestStaticLibrary.kTagSprite1); }
public override void onEnter() { base.onEnter(); m_emitter = CCParticleFire.node(); m_background.addChild(m_emitter, 10); m_emitter.Texture = CCTextureCache.sharedTextureCache().addImage(TestResource.s_fire); //.pvr"]; CCPoint p = m_emitter.position; m_emitter.position = new CCPoint(p.x, 100); setEmitterPosition(); }
void AddShip(CCRect bounds) { ship = new CCDrawNode(); CCPoint[] points = { new CCPoint(0, 25), new CCPoint(50, 0), new CCPoint(0, -25) }; ship.DrawPolygon(points, points.Length, CCColor4B.White, 1.0f, CCColor4B.Orange); ship.Position = new CCPoint(bounds.MinX + 100.0f, bounds.MidY); AddChild(ship); var fire = new CCParticleFire(new CCPoint(-10.0f, 0.0f)); fire.Rotation = -90.0f; fire.Scale = 0.5f; ship.AddChild(fire); }
public static new CCParticleFire Create() { var ret = new CCParticleFire(); ret.InitWithTotalParticles(250); return ret; }
void HandleViewCreated(object sender, EventArgs e) { //loads the view var ccGView = sender as CCGameView; var contentSearchPaths = new List <string>() { "Resources", "Assets" }; ccGView.ContentManager.SearchPaths = contentSearchPaths; if (ccGView != null) { //if the view is created then load all the assets ccGView.DesignResolution = new CCSizeI(App.Width, App.Height); _scene = new CCScene(ccGView); _layer = new CCLayer(); _scene.AddLayer(_layer); //ship ship = new Ship(this); ship.PositionX = ((App.Width) / 2); ship.PositionY = ((App.Height) / 4); _layer.AddChild(ship); //starts are generated as particles var stars = new CCParticleRain(new CCPoint(200, App.Height)) { StartSize = 1, Color = CCColor3B.White, Speed = 250, SourcePosition = new CCPoint(0.0f, -10.0f), }; stars.StartColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f); _layer.AddChild(stars); var faststars = new CCParticleRain(new CCPoint(200, App.Height)) { StartSize = 1, Speed = 500, SourcePosition = new CCPoint(0.0f, -10.0f), }; faststars.StartColor = new CCColor4F(1.0f, 1.0f, 1.0f, 1.0f); _layer.AddChild(faststars); var slowstars = new CCParticleRain(new CCPoint(200, App.Height)) { TotalParticles = 1, StartSize = 2, Color = CCColor3B.Blue, Speed = 50, SourcePosition = new CCPoint(0.0f, -10.0f), }; faststars.StartColor = new CCColor4F(0.0f, 0.0f, 1.0f, 1.0f); _layer.AddChild(slowstars); //the fire trailing the rocket fire = new CCParticleFire(new CCPoint(((App.Width) / 2), ((App.Height) / 4))) { StartSize = 1, Angle = 270, Speed = 100, SourcePosition = new CCPoint(0.0f, -10.0f), }; _layer.AddChild(fire); //the handlers for the screne being touched var touchEvent = new CCEventListenerTouchAllAtOnce(); touchEvent.OnTouchesEnded = OnTouchesEnded; _layer.AddEventListener(touchEvent); //asteroid asteroids = new List <Asteroid>(); void HandleAsteroidCreated(Asteroid newAsteroid) { _layer.AddChild(newAsteroid); asteroids.Add(newAsteroid); } AsteroidFactory.Self.AsteroidCreated += HandleAsteroidCreated; //psyche psyche = new Psyche(); psyche.PositionX = 200; psyche.PositionY = 4000; psyche.VelocityY = -50; _layer.AddChild(psyche); ccGView.RunWithScene(_scene); } }