public GameLayer()
            : base(CCColor4B.Blue, CCColor4B.AliceBlue)
        {
            // Set the layer gradient direction
            this.Vector = new CCPoint(0.5f, 0.5f);

            // Create and add sprites
            monkeySprite1 = new CCSprite("monkey");
            AddChild(monkeySprite1, 1);

            monkeySprite2 = new CCSprite("monkey");
            AddChild(monkeySprite2, 1);

            // Define actions
            var moveUp = new CCMoveBy(1.0f, new CCPoint(0.0f, 50.0f));
            var moveDown = moveUp.Reverse();

            // A CCSequence action runs the list of actions in ... sequence!
            CCSequence moveSeq = new CCSequence(new CCEaseBackInOut(moveUp), new CCEaseBackInOut(moveDown));

            repeatedAction = new CCRepeatForever(moveSeq);

            // A CCSpawn action runs the list of actions concurrently
            dreamAction = new CCSpawn(new CCFadeIn(5.0f), new CCWaves(5.0f, new CCGridSize(10, 20), 4, 4));

            // Schedule for method to be called every 0.1s
            Schedule(UpdateLayerGradient, 0.1f);
        }
        public GameLayer()
            : base(CCColor4B.Blue, CCColor4B.AliceBlue)
        {
            // Set the layer gradient direction
            this.Vector = new CCPoint (0.5f, 0.5f);

            // Create and add sprites
            // We will later be applying a wave action to these sprites
            // These type of actions can only be applied to CCNodeGrid instances
            // Therefore, wrap our sprites in a CCNodeGrid parent
            monkeySprite1 = new CCNodeGrid ();
            monkeySprite1.AddChild (new CCSprite ("monkey"));
            AddChild (monkeySprite1);

            monkeySprite2 = new CCNodeGrid ();
            monkeySprite2.AddChild (new CCSprite ("monkey"));
            AddChild (monkeySprite2);

            // Define actions
            var moveUp = new CCMoveBy (1.0f, new CCPoint (0.0f, 50.0f));
            var moveDown = moveUp.Reverse ();

            // A CCSequence action runs the list of actions in ... sequence!
            CCSequence moveSeq = new CCSequence (new CCEaseBackInOut (moveUp), new CCEaseBackInOut (moveDown));

            repeatedAction = new CCRepeatForever (moveSeq);

            // A CCSpawn action runs the list of actions concurrently
            dreamAction = new CCSpawn (new CCFadeIn (5.0f), new CCWaves (5.0f, new CCGridSize (10, 20), 4, 4));

            // Schedule for method to be called every 0.1s
            Schedule (UpdateLayerGradient, 0.1f);
        }
示例#3
0
        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);
        }
示例#4
0
        public override void OnEnter()
        {
            //
            // This test MUST be done in 'onEnter' and not on 'init'
            // otherwise the paused action will be resumed at 'onEnter' time
            //
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            CCLabelTtf l = new CCLabelTtf("After 5 seconds grossini should move", "arial", 16);
            AddChild(l);
            l.Position = (new CCPoint(s.Width / 2, 245));


            //
            // Also, this test MUST be done, after [super onEnter]
            //
            CCSprite grossini = new CCSprite(s_pPathGrossini);
            AddChild(grossini, 0, kTagGrossini);
            grossini.Position = (new CCPoint(200, 200));

            CCAction action = new CCMoveBy (1, new CCPoint(150, 0));

            grossini.AddAction(action, true);

            Schedule(unpause, 3);
        }
示例#5
0
        public override void OnEnter()
        {
            base.OnEnter();

            Color = CCColor3B.Blue;
            Opacity = 255;

            // Make sure we set the Opacity to cascade or fadein action will not work correctly.
            Target1.IsOpacityCascaded = true;
            Target2.IsOpacityCascaded = true;

            // Define actions
            var moveUp = new CCMoveBy(1.0f, new CCPoint(0.0f, 50.0f));
            var moveDown = moveUp.Reverse();

            // A CCSequence action runs the list of actions in ... sequence!
            var moveSeq = new CCSequence(new CCEaseBackInOut(moveUp), new CCEaseBackInOut(moveDown));

            var repeatedAction = new CCRepeatForever(moveSeq);

            // A CCSpawn action runs the list of actions concurrently
            var dreamAction = new CCSpawn(new CCFadeIn(5.0f), new CCWaves(5.0f, new CCGridSize(10, 20), 5, 20, true, false));


            Target1.RunActions(dreamAction, repeatedAction);

            Target2.RunActions(dreamAction, new CCDelayTime(0.5f), repeatedAction);

            // moving background. Testing issue #244
            var move = new CCMoveBy (3, new CCPoint(200, 0));

            bgNode.RepeatForever(move, move.Reverse());
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize winSize = VisibleBoundsWorldspace.Size;
            float x = winSize.Center.X;
            float y = winSize.Center.Y;

            //var widgetSize = _widget->getContentSize();

            var moveTo = new CCMoveBy(1.0f, new CCPoint(30, 0));
            var moveBack = moveTo.Reverse();
            var rotateBy = new CCRotateBy(1.0f, 180);
            var scaleBy = new CCScaleTo(1.0f, -2.0f);
            var action = new CCSequence(moveTo, moveBack, rotateBy, scaleBy);


            var normalSprite1 = new CCSprite("Images/animationbuttonnormal.png");
            normalSprite1.Position = winSize.Center;
            normalSprite1.PositionX -= 100;
            normalSprite1.PositionY += 100;
            normalSprite1.FlipY = true;


            AddChild(normalSprite1);
            normalSprite1.RunAction(action);

            var normalSprite2 = new CCScale9Sprite("Images/animationbuttonnormal.png");
            normalSprite2.Position = winSize.Center;
            normalSprite2.PositionX -= 80;
            normalSprite2.PositionY += 100;
            normalSprite2.IsScale9Enabled = false;
            normalSprite2.Opacity = 100;
            AddChild(normalSprite2);
            normalSprite2.Color = CCColor3B.Green;
            normalSprite2.RunAction(action);

            
            var sp1 = new CCScale9Sprite("Images/animationbuttonnormal.png");
            sp1.Position = winSize.Center;
            sp1.PositionX -= 100;
            sp1.PositionY -= 50;
            sp1.Scale = 1.2f;
            sp1.ContentSize = new CCSize(100, 100);
            sp1.Color = CCColor3B.Green;
            AddChild(sp1);
            sp1.RunAction(action);

            var sp2 = new CCScale9Sprite("Images/animationbuttonnormal.png");
            sp2.Position = winSize.Center;
            sp2.PositionX += 100;
            sp2.PositionY -= 50;
            sp2.PreferredSize = sp1.ContentSize * 1.2f;
            sp2.ContentSize = new CCSize(100, 100);
            sp2.Color = CCColor3B.Green;
            AddChild(sp2);
            sp2.RunAction(action);

        }
示例#7
0
        public Parallax1()
        {
            // Top Layer, a simple image
            CCSprite cocosImage = new CCSprite(s_Power);
            // scale the image (optional)
            cocosImage.Scale = 2.5f;
            // change the transform anchor point to 0,0 (optional)
            cocosImage.AnchorPoint = new CCPoint(0, 0);


//            // Middle layer: a Tile map atlas
//            CCTileMapAtlas tilemap = new CCTileMapAtlas(s_TilesPng, s_LevelMapTga, 16, 16);
//            tilemap.ReleaseMap();
//
//            // change the transform anchor to 0,0 (optional)
//            tilemap.AnchorPoint = new CCPoint(0, 0);
//
//            // Anti Aliased images
//			tilemap.IsAntialiased = true;


            // background layer: another image
            CCSprite background = new CCSprite(TestResource.s_back);
            // scale the image (optional)
            background.Scale = 1.5f;
            // change the transform anchor point (optional)
            background.AnchorPoint = new CCPoint(0, 0);


            // create a void node, a parent node
            CCParallaxNode voidNode = new CCParallaxNode();

            // NOW add the 3 layers to the 'void' node

            // background image is moved at a ratio of 0.4x, 0.5y
            voidNode.AddChild(background, -1, new CCPoint(0.4f, 0.5f), new CCPoint(0, 0));

            // tiles are moved at a ratio of 2.2x, 1.0y
//            voidNode.AddChild(tilemap, 1, new CCPoint(2.2f, 1.0f), new CCPoint(0, -200));

            // top image is moved at a ratio of 3.0x, 2.5y
            voidNode.AddChild(cocosImage, 2, new CCPoint(3.0f, 2.5f), new CCPoint(200, 800));


            // now create some actions that will move the 'void' node
            // and the children of the 'void' node will move at different
            // speed, thus, simulation the 3D environment
            CCMoveBy goUp = new CCMoveBy (4, new CCPoint(0, -500));
            CCFiniteTimeAction goDown = goUp.Reverse();
            CCMoveBy go = new CCMoveBy (8, new CCPoint(-1000, 0));
            CCFiniteTimeAction goBack = go.Reverse();
            CCFiniteTimeAction seq = new CCSequence(goUp, go, goDown, goBack);

            voidNode.RunAction(new CCRepeatForever ((CCFiniteTimeAction) seq));

            AddChild(voidNode, -1, kTagTileMap);
        }
示例#8
0
        public override void OnEnter()
        {
			base.OnEnter();

			var waves = new CCWaves(5, new CCGridSize(15, 10), 5, 20, true, false);
			var shaky = new CCShaky3D(5, new CCGridSize(15, 10), 4, false);

			Target1.RepeatForever(waves);
			Target2.RepeatForever(shaky);

            // moving background. Testing issue #244
			var move = new CCMoveBy (3, new CCPoint(200, 0));

            bgNode.RepeatForever(move, move.Reverse());
        }
示例#9
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            CCMoveBy pMove = new CCMoveBy (2, new CCPoint(200, 0));
            CCCallFunc pCallback = new CCCallFunc(stopAction);
            CCFiniteTimeAction pSequence = (CCFiniteTimeAction)new CCSequence(pMove, pCallback);
            pSequence.Tag = (int)KTag.kTagSequence;

            CCSprite pChild = new CCSprite(s_pPathGrossini);
            pChild.Position = (new CCPoint(200, 200));

            AddChild(pChild, 1, kTagGrossini);
            pChild.RunAction(pSequence);
        }
示例#10
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            // the root object just rotates around
            m_root = new CCSprite(s_pPathR1);
            AddChild(m_root, 1);
            m_root.Position = new CCPoint(s.Width / 2, s.Height / 2);

            // the target object is offset from root, and the streak is moved to follow it
            m_target = new CCSprite(s_pPathR1);
            m_root.AddChild(m_target);
            m_target.Position = new CCPoint(s.Width / 4, 0);

            // create the streak object and add it to the scene
            streak = new CCMotionStreak(2, 3, 32, CCColor3B.Green, s_streak);
            streak.FastMode = true;
            AddChild(streak);
            // schedule an update on each frame so we can syncronize the streak with the target
            Schedule(onUpdate);

            var a1 = new CCRotateBy (2, 360);

            var action1 = new CCRepeatForever (a1);
            var motion = new CCMoveBy (2, new CCPoint(100, 0));
            m_root.RunAction(new CCRepeatForever ((CCFiniteTimeAction)new CCSequence(motion, motion.Reverse())));
            m_root.RunAction(action1);

            var colorAction = new CCRepeatForever ((CCFiniteTimeAction)
                new CCSequence(
                    new CCTintTo (0.2f, 255, 0, 0),
                    new CCTintTo (0.2f, 0, 255, 0),
                    new CCTintTo (0.2f, 0, 0, 255),
                    new CCTintTo (0.2f, 0, 255, 255),
                    new CCTintTo (0.2f, 255, 255, 0),
                    new CCTintTo (0.2f, 255, 0, 255),
                    new CCTintTo (0.2f, 255, 255, 255)
                    )
                );

            streak.RunAction(colorAction);
        }
示例#11
0
        public override void OnEnter()
        {
			base.OnEnter();

			//var bg = this[EffectAdvanceScene.kTagBackground];
			//var target1 = bg[EffectAdvanceScene.kTagSprite1];
			//var target2 = bg[EffectAdvanceScene.kTagSprite2];

			var waves = new CCWaves(5, new CCGridSize(15, 10), 5, 20, true, false);
			var shaky = new CCShaky3D(5, new CCGridSize(15, 10), 4, false);

			grossini.RepeatForever(waves);
			tamara.RepeatForever(shaky);

            // moving background. Testing issue #244
			var move = new CCMoveBy (3, new CCPoint(200, 0));

            bgNode.RepeatForever(move, move.Reverse());
        }
示例#12
0
        public override void OnEnter()
        {

            base.OnEnter(); 

            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CenterSprites(1);

            Grossini.Position = new CCPoint(-200, windowSize.Height / 2);
            var move = new CCMoveBy (2, new CCPoint(windowSize.Width * 3, 0));
            var move_back = move.Reverse();
            var seq = new CCSequence(move, move_back);
            var rep = new CCRepeatForever(seq);

            Grossini.RunAction(rep);

            RunAction(new CCFollow (Grossini, new CCRect(0, 0, windowSize.Width * 2 - 100, windowSize.Height)));
        }
示例#13
0
        public override void OnEnter()
        {
            base.OnEnter(); 

            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CenterSprites(3);

            var actionTo = new CCMoveTo (2, new CCPoint(windowSize.Width - 40, windowSize.Height - 40));
            var actionBy = new CCMoveBy (2, new CCPoint(80, 80));
            var actionByBack = actionBy.Reverse();

            Tamara.RunAction(new CCSequence(actionTo, new CCCallFunc(new Action(() =>
                {
                    if ((Tamara.Position.X != windowSize.Width - 40) || (Tamara.Position.Y != windowSize.Height - 40))
                    {
                        CCLog.Log("ERROR: MoveTo on tamara has failed. Position of tamara = {0}, expected = {1},{2}", Tamara.Position, windowSize.Width - 40, windowSize.Height - 40);
                    }
                }))));
            Grossini.RunAction(new CCSequence(actionBy, actionByBack));
            Kathia.RunAction(new CCSequence(new CCMoveTo(1, new CCPoint(40, 40)), new CCCallFunc(new Action(() =>
                {
                    if (Kathia.Position.X != 40 || Kathia.Position.Y != 40)
                    {
                        CCLog.Log("ERROR: MoveTo on kathia failed. Expected 40,40 but ended at {0}", Kathia.Position);
                    }
                }))));
        }
示例#14
0
        public override void OnEnter()
        {
            base.OnEnter(); 
            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CenterSprites(3);

            var actionTo = new CCMoveTo(2, new CCPoint(windowSize.Width - 40, windowSize.Height - 40));
            var actionBy = new CCMoveBy(2, new CCPoint(80, 80));
            var actionByBack = actionBy.Reverse();

            Tamara.RunAction(new CCSequence(new CCParallel(actionTo, new CCFadeIn(2)), actionBy, actionByBack));
            Grossini.RunAction(new CCSequence(actionBy, new CCParallel(actionByBack, new CCScaleTo(2, 0.25f))));
            Kathia.RunAction(new CCMoveTo(1, new CCPoint(40, 40)));
        }
示例#15
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize windowSize = VisibleBoundsWorldspace.Size;

            var move = new CCMoveBy(4, new CCPoint(windowSize.Width / 2, 0));
            backGround.Position = VisibleBoundsWorldspace.Left();
            backGround.PositionX += windowSize.Width / 4;

            // Run background animation
            backGround.RepeatForever(move, move.Reverse());

            backGround.DrawSolidCircle(CCPoint.Zero, 220, CCColor4B.White);
            AddChild(backGround);


            var color = CCColor4B.Red;
            color.A = (byte)(255 * 0.3f);

            // Draw polygons
            //P1: 380:-160 P2: 200:-240 P3: 160:-420
            CCPoint[] points = new CCPoint[]
            {
                //P1: 380:-160 P2: 200:-240 P3: 160:-420
                new CCPoint(380,-160),
                new CCPoint(200,-240),
                new CCPoint(160,-420),
            };

            //P1: 160:-420 P2: 200:-520 P3: 360:-540
            CCPoint[] pointss = new CCPoint[]
            {
                new CCPoint(160,-420),
                new CCPoint(200,-520),
                new CCPoint(360,-540)
            };
            //P1: 360:-540 P2: 420:-600 P3: 520:-520
            CCPoint[] pointss2 = new CCPoint[]
            {
                new CCPoint(360,-540),
                new CCPoint(420,-600),
                new CCPoint(530,-520)
            };
            //P1: 520:-520 P2: 380:-160 P3: 160:-420
            CCPoint[] pointss3 = new CCPoint[]
            {
                new CCPoint(520,-520),
                new CCPoint(380,-160),
                new CCPoint(160,-420)
            };

            // P1: 160:-420 P2: 360:-540 P3: 520:-520
            CCPoint[] pointss4 = new CCPoint[]
            {
                new CCPoint(160,-420),
                new CCPoint(360,-540),
                new CCPoint(520,-520)
            };

            DrawSolidPolygon(points, color);
            DrawSolidPolygon(pointss, color);
            DrawSolidPolygon(pointss2, color);
            DrawSolidPolygon(pointss3, color);
            DrawSolidPolygon(pointss4, color);

            drawTriangles.Position = windowSize.Center;
            // Offset by the bounds of the polygons to more or less center it
            drawTriangles.PositionX -= 370;
            drawTriangles.PositionY += 440;
        }
示例#16
0
        public ActionOrbit()
        {
            var orbit1 = new CCOrbitCamera(2, 1, 0, 0, 180, 0, 0);
            action1 = new CCSequence(orbit1,orbit1.Reverse());

            var orbit2 = new CCOrbitCamera(2, 1, 0, 0, 180, -45, 0);
            action2 = new CCSequence(orbit2, orbit2.Reverse());

            var orbit3 = new CCOrbitCamera(2, 1, 0, 0, 90, 90, 0);
            action3 = new CCSequence(orbit3, orbit3.Reverse());

            var move = new CCMoveBy (3, new CCPoint(100, -100));
            var move_back = move.Reverse();
            var seq = new CCSequence(move, move_back);
            rfe = new CCRepeatForever (seq);
        }
示例#17
0
 public ActionRepeat()
 {
     a1 = new CCMoveBy (1, new CCPoint(150, 0));
     a1Reverse = a1.Reverse();
 }
示例#18
0
        public ActionReverseSequence2()
        {
            var move1 = new CCMoveBy (1, new CCPoint(250, 0));
            var move2 = new CCMoveBy (1, new CCPoint(0, 50));
            var toggle = new CCToggleVisibility();
            var seq = new CCSequence(move1, toggle, move2, toggle, move1.Reverse());
            action = new CCRepeat ((new CCSequence(seq, seq.Reverse())), 3);

            var move_tamara = new CCMoveBy (1, new CCPoint(100, 0));
            var move_tamara2 = new CCMoveBy (1, new CCPoint(50, 0));
            var hide = new CCHide();

            seq_tamara = new CCSequence(move_tamara, hide, move_tamara2);
            seq_back = seq_tamara.Reverse();
        }
示例#19
0
        public ActionReverseSequence()
        {

            var move1 = new CCMoveBy (1, new CCPoint(250, 0));
            var move2 = new CCMoveBy (1, new CCPoint(0, 50));
            var seq = new CCSequence(move1, move2, move1.Reverse());
            action = new CCSequence(seq, seq.Reverse());
        }
示例#20
0
 public ActionDelayTime()
 {
     var move = new CCMoveBy (1, new CCPoint(150, 0));
     action = new CCSequence(move, new CCDelayTime (2), move);
 }
示例#21
0
 void MoveClouds(float dy)
 {
     parallaxClouds.StopAllActions ();
     var moveClouds = new CCMoveBy (1.0f, new CCPoint (0, dy * 0.1f));
     parallaxClouds.RunAction (moveClouds);
 }
示例#22
0
        public TMXReadWriteTest() : base("TileMaps/orthogonal-test2")
        {
            m_gid = CCTileGidAndFlags.EmptyTile;

            CCTileMapLayer layer = tileMap.LayerNamed("Layer 0");
            layer.Antialiased = true;

            tileMap.Scale = (1);

            CCSprite tile0 = layer.ExtractTile(1, 63);
            CCSprite tile1 = layer.ExtractTile(2, 63);
            CCSprite tile2 = layer.ExtractTile(3, 62); //new CCPoint(1,62));
            CCSprite tile3 = layer.ExtractTile(2, 62);
            tile0.AnchorPoint = (new CCPoint(0.5f, 0.5f));
            tile1.AnchorPoint = (new CCPoint(0.5f, 0.5f));
            tile2.AnchorPoint = (new CCPoint(0.5f, 0.5f));
            tile3.AnchorPoint = (new CCPoint(0.5f, 0.5f));

            CCMoveBy move = new CCMoveBy (0.5f, new CCPoint(0, 160));
            CCRotateBy rotate = new CCRotateBy (2, 360);
            CCScaleBy scale = new CCScaleBy(2, 5);
            CCFadeOut opacity = new CCFadeOut  (2);
            CCFadeIn fadein = new CCFadeIn  (2);
            CCScaleTo scaleback = new CCScaleTo(1, 1);
            CCCallFuncN finish = new CCCallFuncN(removeSprite);
			CCSequence sequence = new CCSequence(move, rotate, scale, opacity, fadein, scaleback, finish);

			tile0.RunAction(sequence);
			tile1.RunAction(sequence);
			tile2.RunAction(sequence);
			tile3.RunAction(sequence);


            m_gid = layer.TileGIDAndFlags(0, 63);

            Schedule(updateCol, 2.0f);
            Schedule(repaintWithGID, 2.0f);
            Schedule(removeTiles, 1.0f);


            m_gid2 = CCTileGidAndFlags.EmptyTile;
        }
示例#23
0
        public override void RunActionsInSprite(CCSprite sprite)
        {
            sprite.RunAction(
                new CCRepeatForever(
                    new CCSequence(
                        new CCMoveBy(0.05f, new CCPoint(10, 10)),
                        new CCMoveBy(0.05f, new CCPoint(-10, -10)))
                )
            );

            CCMoveBy action = new CCMoveBy(2.0f, new CCPoint(400, 0));
            CCMoveBy action_back = (CCMoveBy) action.Reverse();

            sprite.RunAction(
                new CCRepeatForever(
                    new CCSequence(action, action_back)
                ));
        }
示例#24
0
        public override void OnEnter()
        {
            base.OnEnter(); 

            CCSize s = tileLayersContainer.ContentSize;
            tileLayersContainer.Position = new CCPoint(-s.Width / 2, 0);

            CCMoveBy move = new CCMoveBy (10, new CCPoint(300, 250));
            CCFiniteTimeAction back = move.Reverse();
            CCSequence seq = new CCSequence(move, back);
            m_tamara.RunAction(new CCRepeatForever (seq));

            Schedule(repositionSprite);

            tileMap.Camera.NearAndFarOrthographicZClipping 
                = new CCNearAndFarClipping(-2000f, 2000f);

            Window.IsUseDepthTesting = true;
        }
示例#25
0
        public override void OnEnter()
        {
            base.OnEnter(); 

            CCSize s = tileLayersContainer.ContentSize;
            CCTileMapLayer layer = tileMap.LayerNamed("Trees");

            CCMoveBy move = new CCMoveBy (5, new CCPoint(500, 550));
            CCMoveBy move2 = new CCMoveBy (5, new CCPoint(250, 250));
            CCFiniteTimeAction back = move.Reverse();
            CCSequence seq = new CCSequence(move, back);

            tileMap.Camera.NearAndFarOrthographicZClipping 
              = new CCNearAndFarClipping(-2000f, 2000f);

            layer.RunAction(seq);
            tileLayersContainer.RunAction(new CCSequence(move2.Reverse(), move2));
        }
示例#26
0
        public override void OnEnter()
        {

            base.OnEnter();

            CenterSprites(0);

            var spr = new CCSprite("Images/grossini");
            spr.Position = new CCPoint(200, 200);
            AddChild(spr);

            var act1 = new CCMoveBy (2, new CCPoint(0, 100));

            var act2 = new CCCallFunc(Log1);
            var act3 = new CCMoveBy (2, new CCPoint(0, -100));
            var act4 = new CCCallFunc(Log2);
            var act5 = new CCMoveBy (2, new CCPoint(100, -100));
            var act6 = new CCCallFunc(Log3);
            var act7 = new CCMoveBy (2, new CCPoint(-100, 0));
            var act8 = new CCCallFunc(Log4);

            var actF = new CCSequence(act1, act2, act3, act4, act5, act6, act7, act8);

            spr.RunAction(actF);
        }
示例#27
0
        public override void OnEnter()
        {
            base.OnEnter();

            var move = new CCMoveBy (10, new CCPoint(400, 450));
            var back = move.Reverse();
			m_tamara.RepeatForever(move, back);

            Schedule(repositionSprite);

            tileMap.Camera.NearAndFarOrthographicZClipping 
            = new CCNearAndFarClipping(-2000f, 2000f);

            Window.IsUseDepthTesting = true;
        }
示例#28
0
        public Issue1288()
        {
            spr = new CCSprite("Images/grossini");
            AddChild(spr);

            var act1 = new CCMoveBy (0.5f, new CCPoint(100, 0));
            var act2 = (CCMoveBy) act1.Reverse();
            var act3 = new CCSequence(act1, act2);
            act4 = new CCRepeat (act3, 2);
        }
示例#29
0
        public override void OnEnter()
        {
            base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            Background.Parent.RemoveChild(Background, true);
            Background = null;

            CCParallaxNode p = new CCParallaxNode();
            AddChild(p, 5);

            CCSprite p1 = new CCSprite(TestResource.s_back3);
            CCSprite p2 = new CCSprite(TestResource.s_back3);

            p.AddChild(p1, 1, new CCPoint(0.5f, 1), new CCPoint(0, 250));
            p.AddChild(p2, 2, new CCPoint(1.5f, 1), new CCPoint(0, 50));

            Emitter = new CCParticleFlower(MidWindowPoint);

            Emitter.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_fire);

            p1.AddChild(Emitter, 10);
            Emitter.Position = new CCPoint(250, 200);

            CCParticleSun par = new CCParticleSun(MidWindowPoint);
            p2.AddChild(par, 10);
            par.Texture = CCTextureCache.SharedTextureCache.AddImage(TestResource.s_fire);

            CCFiniteTimeAction move = new CCMoveBy (4, new CCPoint(300, 0));
            CCFiniteTimeAction move_back = move.Reverse();
            CCFiniteTimeAction seq = new CCSequence(move, move_back);
            p.RunAction(new CCRepeatForever ((CCFiniteTimeAction) seq));
        }
示例#30
0
        public Issue1288_2()
        {
            spr = new CCSprite("Images/grossini");
            AddChild(spr);

            act1 = new CCMoveBy(0.5f, new CCPoint(100, 0));
        }