Пример #1
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)));
        }
Пример #2
0
        public static new CCActionInterval actionWithDuration(float t)
        {
            CCTurnOffTiles fadeout = new CCTurnOffTiles(25, new CCGridSize(48, 32), t);
            CCFiniteTimeAction back = fadeout.Reverse();
            CCDelayTime delay = new CCDelayTime (0.5f);

            return (CCActionInterval)(CCSequence.FromActions(fadeout, delay, back));
        }
Пример #3
0
        public static new CCTurnOffTiles actionWithSize(ccGridSize size, float d)
        {
            CCTurnOffTiles cCTurnOffTile = new CCTurnOffTiles();

            if (cCTurnOffTile.initWithSize(size, d))
            {
                return(cCTurnOffTile);
            }
            return(null);
        }
Пример #4
0
        public static CCTurnOffTiles actionWithSeed(int s, ccGridSize gridSize, float duration)
        {
            CCTurnOffTiles cCTurnOffTile = new CCTurnOffTiles();

            if (cCTurnOffTile.initWithSeed(s, gridSize, duration))
            {
                return(cCTurnOffTile);
            }
            return(null);
        }
Пример #5
0
        /// <summary>
        /// creates the action with the grid size and the duration
        /// </summary>
        public static new CCTurnOffTiles actionWithSize(ccGridSize size, float d)
        {
            CCTurnOffTiles pAction = new CCTurnOffTiles();
            if (pAction.initWithSize(size, d))
            {
                return pAction;
            }

            return null;
        }
Пример #6
0
        /// <summary>
        /// creates the action with a random seed, the grid size and the duration 
        /// </summary>
        public static CCTurnOffTiles actionWithSeed(int s, ccGridSize gridSize, float duration)
        {
            CCTurnOffTiles pAction = new CCTurnOffTiles();
            if (pAction.initWithSeed(s, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Пример #7
0
        /// <summary>
        /// creates the action with the grid size and the duration
        /// </summary>
        public new static CCTurnOffTiles actionWithSize(ccGridSize size, float d)
        {
            CCTurnOffTiles pAction = new CCTurnOffTiles();

            if (pAction.initWithSize(size, d))
            {
                return(pAction);
            }

            return(null);
        }
Пример #8
0
 /// <summary>
 /// creates the action with the grid size and the duration
 /// </summary>
 /// <param name="size"></param>
 /// <param name="d"></param>
 /// <returns></returns>
 public static CCTurnOffTiles actionWithSize(ccGridSize size, float d)
 {
     CCTurnOffTiles pAction = new CCTurnOffTiles();
     if (pAction.initWithSize(size, d))
     {
         //pAction->autorelease();
     }
     else
     {
         //CC_SAFE_RELEASE_NULL(pAction);
     }
     return pAction;
 }
Пример #9
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize             winSize            = CCDirector.sharedDirector().getWinSize();
            int                num                = (int)(12f * (winSize.width / winSize.height));
            int                num1               = 12;
            CCTurnOffTiles     cCTurnOffTile      = CCTurnOffTiles.actionWithSize(new ccGridSize(num, num1), this.m_fDuration);
            CCFiniteTimeAction cCFiniteTimeAction = this.easeActionWithAction(cCTurnOffTile);
            CCScene            mPOutScene         = this.m_pOutScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { cCFiniteTimeAction, CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)), CCStopGrid.action() };
            mPOutScene.runAction(CCSequence.actions(cCFiniteTimeActionArray));
        }
Пример #10
0
        public override CCObject copyWithZone(CCZone pZone)
        {
            CCTurnOffTiles cCTurnOffTile = null;

            if (pZone == null || pZone.m_pCopyObject == null)
            {
                cCTurnOffTile = new CCTurnOffTiles();
                pZone         = new CCZone(cCTurnOffTile);
            }
            else
            {
                cCTurnOffTile = (CCTurnOffTiles)pZone.m_pCopyObject;
            }
            base.copyWithZone(pZone);
            cCTurnOffTile.initWithSeed(this.m_nSeed, this.m_sGridSize, this.m_fDuration);
            return(cCTurnOffTile);
        }
Пример #11
0
        /// <summary>
        /// * creates the action with a random seed, the grid size and the duration 
        /// </summary>
        /// <param name="s"></param>
        /// <param name="gridSize"></param>
        /// <param name="duration"></param>
        /// <returns></returns>
        public static CCTurnOffTiles actionWithSeed(int s, ccGridSize gridSize, float duration)
        {
            CCTurnOffTiles pAction = new CCTurnOffTiles();

            if (pAction != null)
            {
                if (pAction.initWithSeed(s, gridSize, duration))
                {
                    //pAction->autorelease();
                }
                else
                {
                    //CC_SAFE_RELEASE_NULL(pAction);
                }
            }

            return pAction;
        }
Пример #12
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize s      = Director.SharedDirector.DesignSize;
            float  aspect = s.Width / s.Height;
            int    x      = (int)(12 * aspect);
            int    y      = 12;

            CCTurnOffTiles     toff   = CCTurnOffTiles.actionWithSize(new ccGridSize(x, y), m_fDuration);
            CCFiniteTimeAction action = easeActionWithAction(toff);

            m_pOutScene.RunAction
            (
                CCSequence.actions
                (
                    action,
                    CCCallFunc.actionWithTarget(this, (base.finish)),
                    CCStopGrid.action()
                )
            );
        }
Пример #13
0
        public override CCObject copyWithZone(CCZone pZone)
        {
            CCZone pNewZone = null;
            CCTurnOffTiles pCopy = null;
            if (pZone != null && pZone.m_pCopyObject != null)
            {
                pCopy = (CCTurnOffTiles)(pZone.m_pCopyObject);
            }
            else
            {
                pCopy = new CCTurnOffTiles();
                pZone = pNewZone = new CCZone(pCopy);
            }

            base.copyWithZone(pZone);

            pCopy.initWithSeed(m_nSeed, m_sGridSize, Duration);

            //CC_SAFE_DELETE(pNewZone);
            pNewZone = null;
            return pCopy;
        }
Пример #14
0
        public override CCObject copyWithZone(CCZone pZone)
        {
            CCZone         pNewZone = null;
            CCTurnOffTiles pCopy    = null;

            if (pZone != null && pZone.m_pCopyObject != null)
            {
                pCopy = (CCTurnOffTiles)(pZone.m_pCopyObject);
            }
            else
            {
                pCopy = new CCTurnOffTiles();
                pZone = pNewZone = new CCZone(pCopy);
            }

            base.copyWithZone(pZone);

            pCopy.initWithSeed(m_nSeed, m_sGridSize, Duration);

            //CC_SAFE_DELETE(pNewZone);
            pNewZone = null;
            return(pCopy);
        }