Ejemplo n.º 1
0
        public void CreateWayPoint(int pTargetQuad)
        {
            if (pTargetQuad == 1)
            {
                mRandX = mRand.Next(0, (int)mMiddleX);
                mRandY = mRand.Next(0, (int)mMiddleY);
            }
            else if (pTargetQuad == 2)
            {
                mRandX = mRand.Next((int)mMiddleX, Constants.REGION_PLAYABLE_WIDTH);
                mRandY = mRand.Next(0, (int)mMiddleY);
            }
            else if (pTargetQuad == 3)
            {
                mRandX = mRand.Next((int)mMiddleX, Constants.REGION_PLAYABLE_WIDTH);
                mRandY = mRand.Next((int)mMiddleY, Constants.REGION_PLAYABLE_HEIGHT);
            }
            else if (pTargetQuad == 4)
            {
                mRandX = mRand.Next(0, (int)mMiddleX);
                mRandY = mRand.Next((int)mMiddleY, Constants.REGION_PLAYABLE_HEIGHT);
            }

            mWayPoint = new PointCollision(mRandX, mRandY);
        }
Ejemplo n.º 2
0
        public bool isCollidingPoint(PointCollision pPoint)
        {
            mDistance = (float)Math.Sqrt(Math.Pow((mXPos - pPoint.mXPos), 2) + Math.Pow((mYPos - pPoint.mYPos), 2));

            if (mDistance <= mRadius)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 3
0
        public bool isCollidingPoint(PointCollision pPoint)
        {
            mDistance = (float)Math.Sqrt(Math.Pow((mXPos - pPoint.mXPos), 2) + Math.Pow((mYPos - pPoint.mYPos), 2));

            if (mDistance <= mRadius)
            {
                return true;
            }

            return false;
        }