Exemplo n.º 1
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = CCDirector.SharedDirector.WinSize;

            var move      = new CCMoveBy(3, new CCPoint(s.Width - 130, 0));
            var move_back = move.Reverse();

            var move_ease_in      = new CCEaseBackIn((CCActionInterval)(move.Copy()));
            var move_ease_in_back = move_ease_in.Reverse();

            var move_ease_out      = new CCEaseBackOut((CCActionInterval)(move.Copy()));
            var move_ease_out_back = move_ease_out.Reverse();

            var delay = new CCDelayTime(0.25f);

            var seq1 = CCSequence.FromActions(move, delay, move_back, (CCFiniteTimeAction)delay.Copy());
            var seq2 = CCSequence.FromActions(move_ease_in, (CCFiniteTimeAction)delay.Copy(), move_ease_in_back, (CCFiniteTimeAction)delay.Copy());
            var seq3 = CCSequence.FromActions(move_ease_out, (CCFiniteTimeAction)delay.Copy(), move_ease_out_back,
                                              (CCFiniteTimeAction)delay.Copy());

            m_grossini.RunAction(new CCRepeatForever(seq1));
            m_tamara.RunAction(new CCRepeatForever(seq2));
            m_kathia.RunAction(new CCRepeatForever(seq3));
        }
Exemplo n.º 2
0
        public GameScoresLayer()
        {
            var touchListener = new CCEventListenerTouchAllAtOnce();

            touchListener.OnTouchesBegan = (touches, ccevent) => {
                var mainGame             = GameStartLayer.CreateScene(Window);
                var transitionToGameOver = new CCTransitionMoveInL(0.3f, mainGame);

                Director.ReplaceScene(transitionToGameOver);
            };

            AddEventListener(touchListener, this);

            scoreMessage = String.Format("Current High Score");

            Color = new CCColor3B(127, 200, 205);

            Opacity = 255;

            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);
        }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            // todo : CCOrbitCamera hasn't been implement

            base.OnEnter();

            centerSprites(3);

            var orbit1  = new CCOrbitCamera(2, 1, 0, 0, 180, 0, 0);
            var action1 = CCSequence.FromActions(orbit1, orbit1.Reverse());

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

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

            m_kathia.RunAction(new CCRepeatForever(action1));
            m_tamara.RunAction(new CCRepeatForever(action2));
            m_grossini.RunAction(new CCRepeatForever(action3));

            var move      = new CCMoveBy(3, new CCPoint(100, -100));
            var move_back = move.Reverse();
            var seq       = CCSequence.FromActions(move, move_back);
            var rfe       = new CCRepeatForever(seq);

            m_kathia.RunAction(rfe);
            m_tamara.RunAction((CCAction)(rfe.Copy()));
            m_grossini.RunAction((CCAction)(rfe.Copy()));
        }
Exemplo n.º 4
0
        public NodeToWorld()
        {
            //
            // This code tests that nodeToParent works OK:
            //  - It tests different anchor Points
            //  - It tests different children anchor points

            CCSprite back = new CCSprite(TestResource.s_back3);

            AddChild(back, -10);
            back.AnchorPoint = (new CCPoint(0, 0));
            CCSize backSize = back.ContentSize;

            CCMenuItem item = new CCMenuItemImage(TestResource.s_PlayNormal, TestResource.s_PlaySelect);
            CCMenu     menu = new CCMenu(item);

            menu.AlignItemsVertically();
            menu.Position = (new CCPoint(backSize.Width / 2, backSize.Height / 2));
            back.AddChild(menu);

            CCActionInterval rot = new CCRotateBy(5, 360);
            CCAction         fe  = new CCRepeatForever(rot);

            item.RunAction(fe);

            CCActionInterval move  = new CCMoveBy(3, new CCPoint(200, 0));
            var move_back          = (CCActionInterval)move.Reverse();
            CCFiniteTimeAction seq = CCSequence.FromActions(move, move_back);
            CCAction           fe2 = new CCRepeatForever((CCActionInterval)seq);

            back.RunAction(fe2);
        }
Exemplo n.º 5
0
        public override void OnEnter()
        {
            base.OnEnter();

            alignSpritesLeft(2);

            // Test:
            //   Sequence should work both with IntervalAction and InstantActions
            var move1  = new CCMoveBy(1, new CCPoint(250, 0));
            var move2  = new CCMoveBy(1, new CCPoint(0, 50));
            var tog1   = new CCToggleVisibility();
            var tog2   = new CCToggleVisibility();
            var seq    = CCSequence.FromActions(move1, tog1, move2, tog2, move1.Reverse());
            var action = new CCRepeat((CCSequence.FromActions(seq, seq.Reverse())), 3);

            // Test:
            //   Also test that the reverse of Hide is Show, and vice-versa
            m_kathia.RunAction(action);

            var move_tamara  = new CCMoveBy(1, new CCPoint(100, 0));
            var move_tamara2 = new CCMoveBy(1, new CCPoint(50, 0));
            var hide         = new CCHide();
            var seq_tamara   = CCSequence.FromActions(move_tamara, hide, move_tamara2);
            var seq_back     = seq_tamara.Reverse();

            m_tamara.RunAction(CCSequence.FromActions(seq_tamara, seq_back));
        }
Exemplo n.º 6
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = Layer.VisibleBoundsWorldspace.Size;

            var move      = new CCMoveBy(3, new CCPoint(s.Width - 130, 0));
            var move_back = move.Reverse();

            var move_ease_in      = new CCEaseBackIn(move);
            var move_ease_in_back = move_ease_in.Reverse();

            var move_ease_out      = new CCEaseBackOut(move);
            var move_ease_out_back = move_ease_out.Reverse();

            var delay = new CCDelayTime(0.25f);

            var seq1 = new CCSequence(move, delay, move_back, delay);
            var seq2 = new CCSequence(move_ease_in, delay, move_ease_in_back, delay);
            var seq3 = new CCSequence(move_ease_out, delay, move_ease_out_back,
                                      delay);

            m_grossini.RunAction(new CCRepeatForever(seq1));
            m_tamara.RunAction(new CCRepeatForever(seq2));
            m_kathia.RunAction(new CCRepeatForever(seq3));
        }
Exemplo n.º 7
0
        protected override void AddedToScene()
        {
            base.AddedToScene();

            var s = VisibleBoundsWorldspace.Size;

            var left  = new CCPoint(s.Width / 4, s.Height / 2);
            var right = new CCPoint(s.Width / 4 * 3, s.Height / 2);

            var sp1 = new CCSprite("Images/grossini.png");

            sp1.Position = new CCPoint(left);
            var move1 = new CCMoveBy(1, new CCPoint(s.Width / 2, 0));

            AddChild(sp1);
            sp1.RepeatForever(move1, move1.Reverse());


            var sp2 = new CCSprite("Images/grossinis_sister1.png");

            sp2.Position = new CCPoint(right);
            var move2 = new CCMoveBy(1, new CCPoint(-s.Width / 2, 0));

            AddChild(sp2);
            sp2.RepeatForever(move2, move2.Reverse());

            var label1 = new CCLabel("capture all", "fonts/arial", 24, CCLabelFormat.SpriteFont);
            var mi1    = new CCMenuItemLabel(label1, OnCapture);
            var menu   = new CCMenu(mi1);

            AddChild(menu);
            menu.Position = new CCPoint(s.Width / 2, s.Height / 4);
        }
Exemplo n.º 8
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());
        }
Exemplo n.º 9
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 = CCTileMapAtlas.Create(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.Texture.SetAntiAliasTexParameters();


            // 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    = CCSequence.FromActions(goUp, go, goDown, goBack);

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

            AddChild(voidNode, -1, kTagTileMap);
        }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        public override void OnEnter()
        {
            base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

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

            m_tamara.RepeatForever(move, back);

            Schedule(repositionSprite);
        }
Exemplo n.º 13
0
        protected override void AddedToScene()
        {
            base.AddedToScene();

            var winSize = VisibleBoundsWorldspace.Size;

            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 buttonNormal = new CCSprite("Images/animationbuttonnormal.png");
            var button1      = new Button(buttonNormal,
                                          new CCLabel("Click", "fonts/arial", 20, CCLabelFormat.SpriteFont));

            button1.Position   = winSize.Center;
            button1.PositionX -= 100;
            button1.PositionY += 100;

            AddChild(button1);
            button1.RunAction(action);

            var button2 = new Button(buttonNormal,
                                     new CCLabel("Me", "fonts/arial", 20, CCLabelFormat.SpriteFont));

            button2.Position   = winSize.Center;
            button2.PositionX += 100;
            button2.PositionY += 100;

            AddChild(button2);
            button2.RunAction(action);

            var button3 = new Button(buttonNormal,
                                     new CCLabel("Ple", "fonts/arial", 20, CCLabelFormat.SpriteFont));

            button3.Position   = winSize.Center;
            button3.PositionX -= 100;
            button3.PositionY -= 100;

            AddChild(button3);
            button3.RunAction(action);

            var button4 = new Button(buttonNormal,
                                     new CCLabel("ase", "fonts/arial", 20, CCLabelFormat.SpriteFont));

            button4.Position   = winSize.Center;
            button4.PositionX += 100;
            button4.PositionY -= 100;

            AddChild(button4);
            button4.RunAction(action);
        }
Exemplo n.º 14
0
        public override void OnEnter()
        {
            base.OnEnter();

            alignSpritesLeft(1);

            var move1  = new CCMoveBy(1, new CCPoint(250, 0));
            var move2  = new CCMoveBy(1, new CCPoint(0, 50));
            var seq    = CCSequence.FromActions(move1, move2, move1.Reverse());
            var action = CCSequence.FromActions(seq, seq.Reverse());

            m_grossini.RunAction(action);
        }
Exemplo n.º 15
0
        private void CreateLogo(CCRect bounds)
        {
            CCSprite logo = new CCSprite("logo2");

            var             moveUp         = new CCMoveBy(1.0f, new CCPoint(0.0f, 50.0f));
            var             moveDown       = moveUp.Reverse();
            var             moveSeq        = new CCSequence(new CCEaseBackInOut(moveUp), new CCEaseBackInOut(moveDown));
            CCRepeatForever repeatedAction = new CCRepeatForever(moveSeq);

            logo.AnchorPoint = CCPoint.AnchorMiddle;
            logo.Position    = new CCPoint(bounds.Size.Width / 2, bounds.Size.Height * 0.75f);
            logo.RunAction(repeatedAction);
            AddChild(logo);
        }
Exemplo n.º 16
0
        public GameStartLayer() : base(new CCColor4B(127, 200, 205))
        {
            Color   = new CCColor3B(127, 200, 205);
            Opacity = 255;

            // 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));

            repeatedAction = new CCRepeatForever(moveSeq);
        }
Exemplo n.º 17
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());
        }
Exemplo n.º 18
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(3);

            var s = CCDirector.SharedDirector.WinSize;

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

            m_tamara.RunAction(actionTo);
            m_grossini.RunAction(CCSequence.FromActions(actionBy, actionByBack));
            m_kathia.RunAction(new CCMoveTo(1, new CCPoint(40, 40)));
        }
Exemplo n.º 19
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;
        }
Exemplo n.º 20
0
        public override void OnEnter()
        {
            base.OnEnter();

            alignSpritesLeft(2);

            var a1      = new CCMoveBy(1, new CCPoint(150, 0));
            var action1 = new CCRepeat(
                CCSequence.FromActions(new CCPlace(new CCPoint(60, 60)), a1),
                3);
            var action2 = new CCRepeatForever(
                (CCSequence.FromActions((CCActionInterval)(a1.Copy()), a1.Reverse()))
                );

            m_kathia.RunAction(action1);
            m_tamara.RunAction(action2);
        }
Exemplo n.º 21
0
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CCSize s = map.ContentSize;

            map.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);
        }
Exemplo n.º 22
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(1);
            var s = CCDirector.SharedDirector.WinSize;

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

            m_grossini.RunAction(rep);

            RunAction(new CCFollow(m_grossini, new CCRect(0, 0, s.Width * 2 - 100, s.Height)));
        }
Exemplo n.º 23
0
        public override void OnEnter()
        {
            base.OnEnter();

            centerSprites(0);

            var spr = new CCSprite("Images/grossini");

            spr.Position = new CCPoint(100, 100);
            AddChild(spr);

            var act1 = new CCMoveBy(0.5f, new CCPoint(100, 0));
            var act2 = (CCMoveBy)act1.Reverse();
            var act3 = CCSequence.FromActions(act1, act2);
            var act4 = new CCRepeat(act3, 2);

            spr.RunAction(act4);
        }
Exemplo n.º 24
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCNode bg      = GetChildByTag(EffectAdvanceScene.kTagBackground);
            CCNode target1 = bg.GetChildByTag(EffectAdvanceScene.kTagSprite1);
            CCNode target2 = bg.GetChildByTag(EffectAdvanceScene.kTagSprite2);

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

            target1.RunAction(new CCRepeatForever(waves));
            target2.RunAction(new CCRepeatForever(shaky));

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

            bg.RunAction(new CCRepeatForever(new CCSequence(move, move.Reverse())));
        }
Exemplo n.º 25
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());
        }
Exemplo n.º 26
0
        public GameOverLayer(Int64 score)
        {
            var touchListener = new CCEventListenerTouchAllAtOnce();

            touchListener.OnTouchesBegan = (touches, ccevent) => {
                if (touches[0].Location.X < VisibleBoundsWorldspace.Size.Center.X)
                {
                    Window.DefaultDirector.ReplaceScene(GameStartLayer.CreateScene(Window));
                }
                else
                {
                    Window.DefaultDirector.ReplaceScene(GameMainLayer.CreateScene(Window));
                }
            };

            AddEventListener(touchListener, this);

            scoreMessage = String.Format("Game Over.\nYour score: {0}", score);

            if (score > Settings.HighScore)
            {
                scoreMessage      += "\nNew High Score!";
                Settings.HighScore = score;
                highScore          = true;
            }
            else
            {
                scoreMessage += "\nCurrent High Score : " + Settings.HighScore;
            }

            Color = new CCColor3B(127, 200, 205);

            Opacity = 255;

            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);
        }
Exemplo n.º 27
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;
        }
Exemplo n.º 28
0
        //	int redColorIncrement = 10;


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

            // Create and add sprites

            initSprites();
            scaleSprites();
            addChildNodes();


            //	AddChild (monkeySprite1, 1);

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

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


            //	var moveForward = new CCTransitionMoveInR (0.1f,this);

            // A CCSequence action runs the list of actions in ... sequence!
            //CCFiniteTimeAction cfa = new CCEaseIn (moveUp);

            CCSequence moveSeq = new CCSequence(new CCEaseBackIn(moveUp), new CCEaseBackInOut(moveUp));

            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));

            //	CCAction moveR = new Action

            // Schedule for method to be called every 0.1s
            Schedule(UpdateLayerGradient, 0.1f);
        }
Exemplo n.º 29
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = CCDirector.SharedDirector.WinSize;

            var move      = new CCMoveBy(3, new CCPoint(s.Width - 130, 0));
            var move_back = move.Reverse();

            var move_ease      = new CCEaseExponentialInOut((CCActionInterval)move.Copy());
            var move_ease_back = move_ease.Reverse(); //-. reverse()

            var delay = new CCDelayTime(0.25f);

            var seq1 = CCSequence.FromActions(move, delay, move_back, (CCFiniteTimeAction)delay.Copy());
            var seq2 = CCSequence.FromActions(move_ease, (CCFiniteTimeAction)delay.Copy(), move_ease_back, (CCFiniteTimeAction)delay.Copy());

            positionForTwo();

            m_grossini.RunAction(new CCRepeatForever(seq1));
            m_tamara.RunAction(new CCRepeatForever(seq2));
        }
Exemplo n.º 30
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = Layer.VisibleBoundsWorldspace.Size;

            var move      = new CCMoveBy(3, new CCPoint(s.Width - 130, 0));
            var move_back = move.Reverse();

            var move_ease      = new CCEaseBackInOut(move);
            var move_ease_back = move_ease.Reverse() as CCFiniteTimeAction;

            var delay = new CCDelayTime(0.25f);

            var seq1 = new CCSequence(move, delay, move_back, delay);
            var seq2 = new CCSequence(move_ease, delay, move_ease_back, delay);

            PositionForTwo();

            m_grossini.RunAction(new CCRepeatForever(seq1));
            m_tamara.RunAction(new CCRepeatForever(seq2));
        }