예제 #1
0
        public override void step(float dt)
        {
            if (m_bBoundarySet)
            {
                // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased
                if (m_bBoundaryFullyCovered)
                {
                    return;
                }

                CCPoint tempPos = CCPointExtension.ccpSub(m_obHalfScreenSize, m_pobFollowedNode.position);
                m_pTarget.position = CCPointExtension.ccp(CCPointExtension.clampf(tempPos.x, m_fLeftBoundary, m_fRightBoundary),
                                                          CCPointExtension.clampf(tempPos.y, m_fBottomBoundary, m_fTopBoundary));
            }
            else
            {
                m_pTarget.position = CCPointExtension.ccpSub(m_obHalfScreenSize, m_pobFollowedNode.position);
            }
        }
예제 #2
0
        public override void update(float dt)
        {
            if (m_pTarget != null)
            {
                float xa = 0;
                float xb = m_sConfig.controlPoint_1.x;
                float xc = m_sConfig.controlPoint_2.x;
                float xd = m_sConfig.endPosition.x;

                float ya = 0;
                float yb = m_sConfig.controlPoint_1.y;
                float yc = m_sConfig.controlPoint_2.y;
                float yd = m_sConfig.endPosition.y;

                float x = bezierat(xa, xb, xc, xd, dt);
                float y = bezierat(ya, yb, yc, yd, dt);
                m_pTarget.position = CCPointExtension.ccpAdd(m_startPosition, CCPointExtension.ccp(x, y));
            }
        }
예제 #3
0
 public CCLayer()
 {
     anchorPoint           = CCPointExtension.ccp(0.5f, 0.5f);
     isRelativeAnchorPoint = false;
 }
예제 #4
0
 public CCScene()
 {
     isRelativeAnchorPoint = false;
     anchorPoint           = CCPointExtension.ccp(0.5f, 0.5f);
     m_eSceneType          = ccSceneFlag.ccNormalScene;
 }