Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualzgintasz

Posted 01 April 2013 - 10:30 AM

Finally, found the solution myself smile.png. Just changed CameraMoved function:

        public static void CameraMoved(float x, float y)
        {
            tempOffsetX += x;
            tempOffsetY += y;
            while (tempOffsetX >= squareSize)
            {
                offsetX -= squareSize;
                tempOffsetX -= squareSize;
            }
            while (tempOffsetX <= -squareSize)
            {
                offsetX += squareSize;
                tempOffsetX += squareSize;
            }
            while (tempOffsetY >= squareSize)
            {
                offsetY -= squareSize;
                tempOffsetY -= squareSize;
            }
            while (tempOffsetY <= -squareSize)
            {
                offsetY += squareSize;
                tempOffsetY += squareSize;
            }
        }

#1zgintasz

Posted 01 April 2013 - 10:23 AM

Finally, found the solution myself :). Just changed CameraMoved function:

        public static void CameraMoved(float x, float y)
        {
            tempOffsetX += x;
            tempOffsetY += y;
            while (tempOffsetX >= squareSize)
            {
                offsetX -= squareSize;
                //calculateCoords(taskas);
                tempOffsetX -= squareSize;
            }
            while (tempOffsetX <= -squareSize)
            {
                offsetX += squareSize;
                tempOffsetX += squareSize;
            }
            while (tempOffsetY >= squareSize)
            {
                offsetY -= squareSize;
                tempOffsetY -= squareSize;
            }
            while (tempOffsetY <= -squareSize)
            {
                offsetY += squareSize;
                tempOffsetY += squareSize;
            }
        }

PARTNERS