Exemplo n.º 1
0
        /// <summary>
        /// sets a new tile
        /// </summary>
        public virtual void setTile(ccGridSize pos, ccQuad3 coords)
        {
            int idx = (m_sGridSize.y * pos.x + pos.y);

            ccQuad3[] vertArray = m_pVertices;
            vertArray[idx] = coords;
        }
Exemplo n.º 2
0
        public bool initWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            bool flag = true;

            this.m_bActive           = false;
            this.m_nReuseGrid        = 0;
            this.m_sGridSize         = gridSize;
            this.m_pTexture          = pTexture;
            this.m_bIsTextureFlipped = bFlipped;
            CCSize contentSizeInPixels = this.m_pTexture.ContentSizeInPixels;

            this.m_obStep = new CCPoint()
            {
                x = contentSizeInPixels.width / (float)this.m_sGridSize.x,
                y = contentSizeInPixels.height / (float)this.m_sGridSize.y
            };
            this.m_pGrabber = new CCGrabber();
            if (this.m_pGrabber == null)
            {
                flag = false;
            }
            else
            {
                this.m_pGrabber.grab(ref this.m_pTexture);
            }
            this.calculateVertexPoints();
            return(flag);
        }
Exemplo n.º 3
0
        public void turnOffTile(ccGridSize pos)
        {
            ccQuad3 coords = new ccQuad3();

            //memset(coords, 0, sizeof(ccQuad3));
            setTile(pos, coords);
        }
        /// <summary>
        /// creates the action with size and duration. See CCGridAction.initWithSize().
        /// </summary>
        /// <seealso cref="CCGridAction"/>
        public static CCTiledGrid3DAction actionWithSize(ccGridSize gridSize, float duration)
        {
            CCTiledGrid3DAction action = new CCTiledGrid3DAction();

            action.initWithSize(gridSize, duration);
            return(action);
        }
Exemplo n.º 5
0
        public bool initWithSize(ccGridSize gridSize, Texture pTexture, bool bFlipped)
        {
            bool bRet = true;

            m_bActive    = false;
            m_nReuseGrid = 0;
            m_sGridSize  = gridSize;

            m_pTexture = pTexture;

            m_bIsTextureFlipped = bFlipped;

            CCSize texSize = m_pTexture.ContentSize;

            m_obStep   = new CCPoint();
            m_obStep.X = texSize.Width / (float)m_sGridSize.x;
            m_obStep.Y = texSize.Height / (float)m_sGridSize.y;

            m_pGrabber = new CCGrabber();
            if (m_pGrabber != null)
            {
                m_pGrabber.grab(ref m_pTexture);
            }
            else
            {
                bRet = false;
            }

            calculateVertexPoints();

            return(bRet);
        }
Exemplo n.º 6
0
        public virtual void transformTile(ccGridSize pos, float distance)
        {
            ccQuad3 _ccQuad3 = this.originalTile(pos);

            if (_ccQuad3 == null)
            {
                return;
            }
            CCPoint    step        = this.m_pTarget.Grid.Step;
            ccVertex3F _ccVertex3F = _ccQuad3.bl;

            _ccVertex3F.x = _ccVertex3F.x + step.x / 2f * (1f - distance);
            ccVertex3F _ccVertex3F1 = _ccQuad3.bl;

            _ccVertex3F1.y = _ccVertex3F1.y + step.y / 2f * (1f - distance);
            ccVertex3F _ccVertex3F2 = _ccQuad3.br;

            _ccVertex3F2.x = _ccVertex3F2.x - step.x / 2f * (1f - distance);
            ccVertex3F _ccVertex3F3 = _ccQuad3.br;

            _ccVertex3F3.y = _ccVertex3F3.y + step.y / 2f * (1f - distance);
            ccVertex3F _ccVertex3F4 = _ccQuad3.tl;

            _ccVertex3F4.x = _ccVertex3F4.x + step.x / 2f * (1f - distance);
            ccVertex3F _ccVertex3F5 = _ccQuad3.tl;

            _ccVertex3F5.y = _ccVertex3F5.y - step.y / 2f * (1f - distance);
            ccVertex3F _ccVertex3F6 = _ccQuad3.tr;

            _ccVertex3F6.x = _ccVertex3F6.x - step.x / 2f * (1f - distance);
            ccVertex3F _ccVertex3F7 = _ccQuad3.tr;

            _ccVertex3F7.y = _ccVertex3F7.y - step.y / 2f * (1f - distance);
            this.setTile(pos, _ccQuad3);
        }
Exemplo n.º 7
0
        public void turnOffTile(ccGridSize pos)
        {
            ccQuad3 coords = new ccQuad3();

            //memset(coords, 0, sizeof(ccQuad3));
            setTile(pos, coords);
        }
Exemplo n.º 8
0
        public bool initWithSize(ccGridSize gridSize)
        {
            CCDirector pDirector = CCDirector.sharedDirector();
            CCSize     s         = pDirector.winSizeInPixels;

            ulong POTWide = ccNextPOT((uint)s.width);
            ulong POTHigh = ccNextPOT((uint)s.height);

            // we only use rgba8888
            CCTexture2DPixelFormat format = CCTexture2DPixelFormat.kCCTexture2DPixelFormat_RGBA8888;

            CCTexture2D pTexture = new CCTexture2D();

            pTexture.initWithData(null, format, (uint)POTWide, (uint)POTHigh, s);

            if (pTexture == null)
            {
                CCLog.Log("cocos2d: CCGrid: error creating texture");
                return(false);
            }

            initWithSize(gridSize, pTexture, false);

            return(true);
        }
Exemplo n.º 9
0
 public CCActionInterval actionWithSize(ccGridSize vector)
 {
     if (!this.m_bBack)
     {
         return(CCPageTurn3D.actionWithSize(vector, this.m_fDuration));
     }
     return(CCReverseTime.actionWithAction(CCPageTurn3D.actionWithSize(vector, this.m_fDuration)));
 }
Exemplo n.º 10
0
 public virtual new bool initWithSize(ccGridSize gridSize, float duration)
 {
     if (gridSize.x != 1 || gridSize.y != 1)
     {
         return(false);
     }
     return(base.initWithSize(gridSize, duration));
 }
Exemplo n.º 11
0
 /// <summary>
 /// creates the action with the grid size and the duration 
 /// </summary>
 public static CCFadeOutUpTiles actionWithSize(ccGridSize gridSize, float time)
 {
     CCFadeOutUpTiles pAction = new CCFadeOutUpTiles();
     if (pAction.initWithSize(gridSize, time))
     {
         return pAction;
     }
     return null;
 }
Exemplo n.º 12
0
        /// <summary>
        /// sets a new vertex at a given position
        /// </summary>
        public void setVertex(ccGridSize pos, ccVertex3F vertex)
        {
            int index = pos.x * (m_sGridSize.y + 1) + pos.y;

            ccVertex3F[] vertArray = m_pVertices;
            vertArray[index].x = vertex.x;
            vertArray[index].y = vertex.y;
            vertArray[index].z = vertex.z;
        }
Exemplo n.º 13
0
 public virtual bool initWithSize(ccGridSize gridSize, float duration)
 {
     if (!base.initWithDuration(duration))
     {
         return(false);
     }
     this.m_sGridSize = gridSize;
     return(true);
 }
Exemplo n.º 14
0
        public void setVertex(ccGridSize pos, ccVertex3F vertex)
        {
            int num = pos.x * (this.m_sGridSize.y + 1) + pos.y;

            ccVertex3F[] mPVertices = this.m_pVertices;
            mPVertices[num].x = vertex.x;
            mPVertices[num].y = vertex.y;
            mPVertices[num].z = vertex.z;
        }
Exemplo n.º 15
0
        /// <summary>
        /// creates the action with the grid size and the duration
        /// </summary>
        public static CCFadeOutUpTiles actionWithSize(ccGridSize gridSize, float time)
        {
            CCFadeOutUpTiles pAction = new CCFadeOutUpTiles();

            if (pAction.initWithSize(gridSize, time))
            {
                return(pAction);
            }
            return(null);
        }
Exemplo n.º 16
0
        public override float testFunc(ccGridSize pos, float time)
        {
            CCPoint cCPoint = new CCPoint((float)((float)this.m_sGridSize.x * (1f - time)), (float)((float)this.m_sGridSize.y * (1f - time)));

            if (pos.x + pos.y == 0)
            {
                return(1f);
            }
            return((float)Math.Pow((double)((cCPoint.x + cCPoint.y) / (float)(pos.x + pos.y)), 6));
        }
Exemplo n.º 17
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;
        }
Exemplo n.º 18
0
        public static CCLens3D actionWithPosition(CCPoint pos, float r, ccGridSize gridSize, float duration)
        {
            CCLens3D cCLens3D = new CCLens3D();

            if (cCLens3D.initWithPosition(pos, r, gridSize, duration))
            {
                return(cCLens3D);
            }
            return(null);
        }
Exemplo n.º 19
0
        public override float testFunc(ccGridSize pos, float time)
        {
            CCPoint n = new CCPoint((float)(m_sGridSize.x * time), (float)(m_sGridSize.y * time));
            if (n.y == 0.0f)
            {
                return 1.0f;
            }

            return (float)Math.Pow(pos.y / n.y, 6);
        }
Exemplo n.º 20
0
        public static CCShuffleTiles actionWithSeed(int s, ccGridSize gridSize, float duration)
        {
            CCShuffleTiles cCShuffleTile = new CCShuffleTiles();

            if (cCShuffleTile.initWithSeed(s, gridSize, duration))
            {
                return(cCShuffleTile);
            }
            return(null);
        }
Exemplo n.º 21
0
        public static CCShaky3D actionWithRange(int range, bool shakeZ, ccGridSize gridSize, float duration)
        {
            CCShaky3D cCShaky3D = new CCShaky3D();

            if (cCShaky3D.initWithRange(range, shakeZ, gridSize, duration))
            {
                return(cCShaky3D);
            }
            return(null);
        }
        /// <summary>
        /// creates the action with size and duration
        /// </summary>
        public static CCGridAction actionWithSize(ccGridSize gridSize, float duration)
        {
            CCGridAction pAction = new CCGridAction();
            if (pAction.initWithSize(gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 23
0
        public static CCLiquid actionWithWaves(int wav, float amp, ccGridSize gridSize, float duration)
        {
            CCLiquid cCLiquid = new CCLiquid();

            if (cCLiquid != null)
            {
                cCLiquid.initWithWaves(wav, amp, gridSize, duration);
            }
            return(cCLiquid);
        }
Exemplo n.º 24
0
        public static new CCFadeOutUpTiles actionWithSize(ccGridSize gridSize, float time)
        {
            CCFadeOutUpTiles cCFadeOutUpTile = new CCFadeOutUpTiles();

            if (cCFadeOutUpTile.initWithSize(gridSize, time))
            {
                return(cCFadeOutUpTile);
            }
            return(null);
        }
Exemplo n.º 25
0
 public bool initWithRange(int nRange, bool bShakeZ, ccGridSize gridSize, float duration)
 {
     if (!base.initWithSize(gridSize, duration))
     {
         return(false);
     }
     this.m_nRandrange = nRange;
     this.m_bShakeZ    = bShakeZ;
     return(true);
 }
Exemplo n.º 26
0
        public static CCGridBase gridWithSize(ccGridSize gridSize)
        {
            CCGridBase cCGridBase = new CCGridBase();

            if (cCGridBase.initWithSize(gridSize))
            {
                return(cCGridBase);
            }
            return(null);
        }
Exemplo n.º 27
0
        public static CCGridBase gridWithSize(ccGridSize gridSize, CCTexture2D texture, bool flipped)
        {
            CCGridBase cCGridBase = new CCGridBase();

            if (cCGridBase.initWithSize(gridSize, texture, flipped))
            {
                return(cCGridBase);
            }
            return(null);
        }
Exemplo n.º 28
0
        public override float testFunc(ccGridSize pos, float time)
        {
            CCPoint cCPoint = new CCPoint((float)((float)this.m_sGridSize.x * time), (float)((float)this.m_sGridSize.y * time));

            if (cCPoint.y == 0f)
            {
                return(1f);
            }
            return((float)Math.Pow((double)((float)pos.y / cCPoint.y), 6));
        }
Exemplo n.º 29
0
        public virtual float testFunc(ccGridSize pos, float time)
        {
            CCPoint cCPoint = new CCPoint((float)((float)this.m_sGridSize.x * time), (float)((float)this.m_sGridSize.y * time));

            if (cCPoint.x + cCPoint.y == 0f)
            {
                return(1f);
            }
            return((float)Math.Pow((double)((float)(pos.x + pos.y) / (cCPoint.x + cCPoint.y)), 6));
        }
Exemplo n.º 30
0
        public static CCWavesTiles3D actionWithWaves(int wav, float amp, ccGridSize gridSize, float duration)
        {
            CCWavesTiles3D cCWavesTiles3D = new CCWavesTiles3D();

            if (cCWavesTiles3D.initWithWaves(wav, amp, gridSize, duration))
            {
                return(cCWavesTiles3D);
            }
            return(null);
        }
Exemplo n.º 31
0
        public static CCWaves actionWithWaves(int wav, float amp, bool h, bool v, ccGridSize gridSize, float duration)
        {
            CCWaves cCWafe = new CCWaves();

            if (cCWafe.initWithWaves(wav, amp, h, v, gridSize, duration))
            {
                return(cCWafe);
            }
            return(null);
        }
Exemplo n.º 32
0
        public virtual float testFunc(ccGridSize pos, float time)
        {
            CCPoint n = new CCPoint((float)(m_sGridSize.x * time), (float)(m_sGridSize.y * time));
            if ((n.X + n.Y) == 0.0f)
            {
                return 1.0f;
            }

            return (float)Math.Pow((pos.x + pos.y) / (n.X + n.Y), 6);
        }
Exemplo n.º 33
0
        public static CCShatteredTiles3D actionWithRange(int nRange, bool bShatterZ, ccGridSize gridSize, float duration)
        {
            CCShatteredTiles3D cCShatteredTiles3D = new CCShatteredTiles3D();

            if (cCShatteredTiles3D.initWithRange(nRange, bShatterZ, gridSize, duration))
            {
                return(cCShatteredTiles3D);
            }
            return(null);
        }
        public virtual float testFunc(ccGridSize pos, float time)
        {
            CCPoint n = new CCPoint((float)(m_sGridSize.x * (1.0f - time)), (float)(m_sGridSize.y * (1.0f - time)));
            if (pos.y == 0)
            {
                return 1.0f;
            }

            return (float)Math.Pow(n.y / pos.y, 6);
        }
Exemplo n.º 35
0
        public static CCJumpTiles3D actionWithJumps(int j, float amp, ccGridSize gridSize, float duration)
        {
            CCJumpTiles3D cCJumpTiles3D = new CCJumpTiles3D();

            if (cCJumpTiles3D.initWithJumps(j, amp, gridSize, duration))
            {
                return(cCJumpTiles3D);
            }
            return(null);
        }
Exemplo n.º 36
0
        public static new CCGrid3D gridWithSize(ccGridSize gridSize)
        {
            CCGrid3D cCGrid3D = new CCGrid3D();

            if (cCGrid3D.initWithSize(gridSize))
            {
                return(cCGrid3D);
            }
            return(null);
        }
Exemplo n.º 37
0
        public static new CCGrid3D gridWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            CCGrid3D cCGrid3D = new CCGrid3D();

            if (cCGrid3D.initWithSize(gridSize, pTexture, bFlipped))
            {
                return(cCGrid3D);
            }
            return(null);
        }
Exemplo n.º 38
0
        public override float testFunc(ccGridSize pos, float time)
        {
            CCPoint n = new CCPoint((float)(m_sGridSize.x * (1.0f - time)), (float)(m_sGridSize.y * (1.0f - time)));
            if ((pos.x + pos.y) == 0)
            {
                return 1.0f;
            }

            return (float)Math.Pow((n.x + n.y) / (pos.x + pos.y), 6);
        }
Exemplo n.º 39
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;
        }
Exemplo n.º 40
0
        /// <summary>
        /// creates the action with a number of waves, the waves amplitude, the grid size and the duration
        /// </summary>
        public static CCWavesTiles3D actionWithWaves(int wav, float amp, ccGridSize gridSize, float duration)
        {
            CCWavesTiles3D pAction = new CCWavesTiles3D();

            if (pAction.initWithWaves(wav, amp, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 41
0
        public static new CCTiledGrid3D gridWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            CCTiledGrid3D pRet = new CCTiledGrid3D();

            if (pRet.initWithSize(gridSize, pTexture, bFlipped))
            {
                return pRet;
            }

            return null;
        }
Exemplo n.º 42
0
        /// <summary>
        /// creates the action with center position, radius, a grid size and duration
        /// </summary>
        public static CCLens3D actionWithPosition(CCPoint pos, float r, ccGridSize gridSize, float duration)
        {
            CCLens3D pAction = new CCLens3D();

            if (pAction.initWithPosition(pos, r, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 43
0
        /// <summary>
        /// creates the action with a range, shake Z vertices, a grid and duration
        /// </summary>
        public static CCShaky3D actionWithRange(int range, bool shakeZ, ccGridSize gridSize, float duration)
        {
            CCShaky3D pAction = new CCShaky3D();

            if (pAction.initWithRange(range, shakeZ, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 44
0
        public static new CCTiledGrid3D gridWithSize(ccGridSize gridSize)
        {
            CCTiledGrid3D pRet = new CCTiledGrid3D();

            if (pRet.initWithSize(gridSize))
            {
                return pRet;
            }

            return null;
        }
Exemplo n.º 45
0
        /// <summary>
        /// create the action
        /// </summary>
        public static CCPageTurn3D actionWithSize(ccGridSize gridSize, float time)
        {
            CCPageTurn3D pAction = new CCPageTurn3D();

            if (pAction.initWithSize(gridSize, time))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 46
0
        /** initializes the action with size and duration */
        public virtual bool initWithSize(ccGridSize gridSize, float duration)
        {
            if (base.initWithDuration(duration))
            {
                m_sGridSize = gridSize;

                return true;
            }

            return false;
        }
Exemplo n.º 47
0
        public static CCJumpTiles3D actionWithJumps(int j, float amp, ccGridSize gridSize, float duration)
        {
            CCJumpTiles3D pAction = new CCJumpTiles3D();

            if (pAction.initWithJumps(j, amp, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
        /// <summary>
        /// creates the action with a range, whether of not to shatter Z vertices, a grid size and duration
        /// </summary>
        public static CCShatteredTiles3D actionWithRange(int nRange, bool bShatterZ, ccGridSize gridSize, float duration)
        {
            CCShatteredTiles3D pAction = new CCShatteredTiles3D();

            if (pAction.initWithRange(nRange, bShatterZ, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 49
0
        public static CCGridBase gridWithSize(ccGridSize gridSize, Texture texture, bool flipped)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase.initWithSize(gridSize, texture, flipped))
            {
                return pGridBase;
            }

            return null;
        }
Exemplo n.º 50
0
        /// <summary>
        ///  creates the action with center position, number of twirls, amplitude, a grid size and duration
        /// </summary>
        public static CCTwirl actionWithPosition(CCPoint pos, int t, float amp, ccGridSize gridSize,
            float duration)
        {
            CCTwirl pAction = new CCTwirl();

            if (pAction.initWithPosition(pos, t, amp, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 51
0
        /// <summary>
        /// initializes the action with a random seed, the grid size and the duration 
        /// </summary>
        public bool initWithSeed(int s, ccGridSize gridSize, float duration)
        {
            if (base.initWithSize(gridSize, duration))
            {
                m_nSeed = s;
                m_pTilesOrder = null;

                return true;
            }

            return false;
        }
Exemplo n.º 52
0
        /// <summary>
        /// initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration
        /// </summary>
        public static CCWaves actionWithWaves(int wav, float amp, bool h, bool v, ccGridSize gridSize,
            float duration)
        {
            CCWaves pAction = new CCWaves();

            if (pAction.initWithWaves(wav, amp, h, v, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 53
0
        public override void transformTile(ccGridSize pos, float distance)
        {
            ccQuad3 coords = originalTile(pos);
            CCPoint step = m_pTarget.Grid.Step;

            coords.bl.y += (step.y / 2) * (1.0f - distance);
            coords.br.y += (step.y / 2) * (1.0f - distance);
            coords.tl.y -= (step.y / 2) * (1.0f - distance);
            coords.tr.y -= (step.y / 2) * (1.0f - distance);

            setTile(pos, coords);
        }
Exemplo n.º 54
0
        public virtual bool initWithSize(ccGridSize gridSize, float duration)
        {
            if (gridSize.x != 1 || gridSize.y != 1)
            {
                // Grid size must be (1,1)
                Debug.Assert(false);

                return false;
            }

            return base.initWithSize(gridSize, duration);
        }
Exemplo n.º 55
0
        /// <summary>
        /// initializes the action with a range, shake Z vertices, a grid and duration
        /// </summary>
        public bool initWithRange(int range, bool shakeZ, ccGridSize gridSize, float duration)
        {
            if (base.initWithSize(gridSize, duration))
            {
                m_nRandrange = range;
                m_bShakeZ = shakeZ;

                return true;
            }

            return false;
        }
Exemplo n.º 56
0
        /// <summary>
        /// creates the action with radius, number of waves, amplitude, a grid size and duration
        /// </summary>
        public static CCRipple3D actionWithPosition(CCPoint pos, float r, int wav, float amp,
            ccGridSize gridSize, float duration)
        {
            CCRipple3D pAction = new CCRipple3D();

            if (pAction.initWithPosition(pos, r, wav, amp, gridSize, duration))
            {
                return pAction;
            }

            return null;
        }
Exemplo n.º 57
0
        /// <summary>
        /// initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration
        /// </summary>
        public bool initWithRange(int nRange, bool bShatterZ, ccGridSize gridSize, float duration)
        {
            if (base.initWithSize(gridSize, duration))
            {
                m_bOnce = false;
                m_nRandrange = nRange;
                m_bShatterZ = bShatterZ;

                return true;
            }

            return false;
        }
Exemplo n.º 58
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;
 }
Exemplo n.º 59
0
        /// <summary>
        ///  init the action
        /// </summary>
        public bool initWithWaves(int wav, float amp, ccGridSize gridSize, float duration)
        {
            if (initWithSize(gridSize, duration))
            {
                m_nWaves = wav;
                m_fAmplitude = amp;
                m_fAmplitudeRate = 1.0f;

                return true;
            }

            return false;
        }
Exemplo n.º 60
0
        /// <summary>
        /// initializes the action with the number of jumps, the sin amplitude, the grid size and the duration 
        /// </summary>
        public bool initWithJumps(int j, float amp, ccGridSize gridSize, float duration)
        {
            if (base.initWithSize(gridSize, duration))
            {
                m_nJumps = j;
                m_fAmplitude = amp;
                m_fAmplitudeRate = 1.0f;

                return true;
            }

            return false;
        }