Beispiel #1
0
        public override void OnEnter()
        {
            base.OnEnter();

            // To reuse a grid the grid size and the grid type must be the same.
            // in this case:
            //     ShakyTiles is TiledGrid3D and it's size is (15,10)
            //     Shuffletiles is TiledGrid3D and it's size is (15,10)
            //	   TurnOfftiles is TiledGrid3D and it's size is (15,10)
            var shaky   = new CCShakyTiles3D(5, new CCGridSize(15, 10), 4, false);
            var shuffle = new CCShuffleTiles(new CCGridSize(15, 10), 3, 0);
            var turnoff = new CCTurnOffTiles(3, new CCGridSize(15, 10), 0);
            var turnon  = turnoff.Reverse();

            // reuse 2 times:
            //   1 for shuffle
            //   2 for turn off
            //   turnon tiles will use a new grid
            var reuse = new CCReuseGrid(2);

            var delay = new CCDelayTime(1);

            //	id orbit = [OrbitCamera::actionWithDuration:5 radius:1 deltaRadius:2 angleZ:0 deltaAngleZ:180 angleX:0 deltaAngleX:-90];
            //	id orbit_back = [orbit reverse];
            //
            //	[target runAction: [RepeatForever::actionWithAction: [Sequence actions: orbit, orbit_back, nil]]];
            bgNode.RunActions(shaky, delay, reuse, shuffle, delay, turnoff, turnon);
        }
Beispiel #2
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCNode target = GetChildByTag(EffectAdvanceScene.kTagBackground);

            // To reuse a grid the grid size and the grid type must be the same.
            // in this case:
            //     ShakyTiles is TiledGrid3D and it's size is (15,10)
            //     Shuffletiles is TiledGrid3D and it's size is (15,10)
            //	   TurnOfftiles is TiledGrid3D and it's size is (15,10)
            CCActionInterval   shaky   = new CCShakyTiles3D(4, false, new CCGridSize(15, 10), 5);
            CCActionInterval   shuffle = new CCShuffleTiles(0, new CCGridSize(15, 10), 3);
            CCActionInterval   turnoff = new CCTurnOffTiles(0, new CCGridSize(15, 10), 3);
            CCFiniteTimeAction turnon  = turnoff.Reverse();

            // reuse 2 times:
            //   1 for shuffle
            //   2 for turn off
            //   turnon tiles will use a new grid
            CCFiniteTimeAction reuse = new CCReuseGrid(2);

            CCActionInterval delay = new CCDelayTime(1);

            //	id orbit = [OrbitCamera::actionWithDuration:5 radius:1 deltaRadius:2 angleZ:0 deltaAngleZ:180 angleX:0 deltaAngleX:-90];
            //	id orbit_back = [orbit reverse];
            //
            //	[target runAction: [RepeatForever::actionWithAction: [Sequence actions: orbit, orbit_back, nil]]];
            target.RunAction((CCSequence.FromActions(shaky, delay, reuse, shuffle, (CCFiniteTimeAction)delay.Copy(), turnoff, turnon)));
        }
Beispiel #3
0
        public new static CCActionInterval actionWithDuration(float t)
        {
            CCTurnOffTiles     fadeout = new CCTurnOffTiles(t, new CCGridSize(48, 32), 25);
            CCFiniteTimeAction back    = fadeout.Reverse();
            CCDelayTime        delay   = new CCDelayTime(0.5f);

            return((CCActionInterval)(new CCSequence(fadeout, delay, back)));
        }
        public static CCFiniteTimeAction ActionWithDuration(float t)
        {
            var fadeout = new CCTurnOffTiles(t, new CCGridSize(48, 32), 25);
            var back    = fadeout.Reverse();
            var delay   = new CCDelayTime(0.5f);

            return(new CCSequence(fadeout, delay, back));
        }
        public new static CCActionInterval actionWithDuration(float t)
        {
            CCTurnOffTiles     fadeout = CCTurnOffTiles.actionWithSeed(25, new ccGridSize(48, 32), t);
            CCFiniteTimeAction back    = fadeout.reverse();
            CCDelayTime        delay   = CCDelayTime.actionWithDuration(0.5f);

            return((CCActionInterval)(CCSequence.actions(fadeout, delay, back)));
        }
Beispiel #6
0
        protected override void InitialiseScenes()
        {
            base.InitialiseScenes();

            var   bounds = Layer.VisibleBoundsWorldspace;
            float aspect = bounds.Size.Width / bounds.Size.Height;
            var   x      = (int)(12 * aspect);
            int   y      = 12;

            toff = new CCTurnOffTiles(Duration, new CCGridSize(x, y));
        }
        protected override void InitialiseScenes()
        {
            base.InitialiseScenes();

            var bounds = Layer.VisibleBoundsWorldspace;
            float aspect = bounds.Size.Width / bounds.Size.Height;
            var x = (int) (12 * aspect);
            int y = 12;

            toff = new CCTurnOffTiles(Duration, new CCGridSize(x, y));
        }
Beispiel #8
0
        public override object Copy(ICopyable pZone)
        {
            CCTurnOffTiles pCopy;
            if (pZone != null)
            {
                pCopy = (CCTurnOffTiles) (pZone);
            }
            else
            {
                pCopy = new CCTurnOffTiles();
                pZone =  (pCopy);
            }

            base.Copy(pZone);

            pCopy.InitWithSeed(m_nSeed, m_sGridSize, m_fDuration);

            return pCopy;
        }
Beispiel #9
0
        public override object Copy(ICCCopyable pZone)
        {
            CCTurnOffTiles pCopy;

            if (pZone != null)
            {
                pCopy = (CCTurnOffTiles)(pZone);
            }
            else
            {
                pCopy = new CCTurnOffTiles();
                pZone = (pCopy);
            }

            base.Copy(pZone);

            pCopy.InitWithSeed(m_nSeed, m_sGridSize, m_fDuration);

            return(pCopy);
        }
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize s = CCDirector.SharedDirector.WinSize;
            float aspect = s.Width / s.Height;
            var x = (int) (12 * aspect);
            int y = 12;

            CCTurnOffTiles toff = new CCTurnOffTiles(new CCGridSize(x, y), m_fDuration);
            CCFiniteTimeAction action = EaseAction(toff);
            m_pOutScene.RunAction
                (
                    CCSequence.FromActions
                        (
                            action,
                            new CCCallFunc((Finish)),
                            CCStopGrid.Create()
                        )
                );
        }
Beispiel #11
0
        public CCTurnOffTilesState (CCTurnOffTiles action, CCNodeGrid target) : base (action, target)
        {
            int i;

            if (action.Seed != CCShuffleTiles.NoSeedSpecified)
            {
                CCRandom.Next (action.Seed);
            }

            CCGridSize gridSize = action.GridSize;
            TilesCount = gridSize.X * gridSize.Y;
            TilesOrder = new int[TilesCount];

            for (i = 0; i < TilesCount; ++i)
            {
                TilesOrder [i] = i;
            }

            Shuffle (TilesOrder, TilesCount);
        }
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize s      = CCDirector.SharedDirector.WinSize;
            float  aspect = s.Width / s.Height;
            var    x      = (int)(12 * aspect);
            int    y      = 12;

            CCTurnOffTiles     toff   = new CCTurnOffTiles(m_fDuration, new CCGridSize(x, y));
            CCFiniteTimeAction action = EaseAction(toff);

            m_pOutScene.RunAction
            (
                new CCSequence
                (
                    action,
                    new CCCallFunc((Finish)),
                    new CCStopGrid()
                )
            );
        }
Beispiel #13
0
        public CCTurnOffTilesState(CCTurnOffTiles action, CCNodeGrid target) : base(action, target)
        {
            int i;

            if (action.Seed != CCShuffleTiles.NoSeedSpecified)
            {
                CCRandom.Next(action.Seed);
            }

            CCGridSize gridSize = action.GridSize;

            TilesCount = gridSize.X * gridSize.Y;
            TilesOrder = new int[TilesCount];

            for (i = 0; i < TilesCount; ++i)
            {
                TilesOrder [i] = i;
            }

            Shuffle(TilesOrder, TilesCount);
        }
Beispiel #14
0
        public static new CCSequence ActionWithDuration(ccTime t)
        {
            var fadeout = new CCTurnOffTiles (25, new ccGridSize (48, 32), t);
            var back = fadeout.Reverse ();
            var delay = new CCDelayTime (0.5f);

            return (CCSequence)CCSequence.Actions (fadeout, delay, back);
        }