Beispiel #1
0
        private void LoadDots() //this loads in the dot and bounds.
        {
            if (_gameContainer.DotList !.Count == 0)
            {
                throw new BasicBlankException("Should have initialized dots first.  Rethink");
            }
            int   z       = 0;
            var   dotSize = GetActualSize(10, 10);
            float currentHiddenLeft;
            float currentHiddenTop;
            float diffs = _spaceHeight - _squareHeight;
            float currentTop;
            float currentLeft;
            var   bigHeight = GetActualSize(40, 40);

            currentHiddenTop = diffs + _whiteRect.Location.Y - diffs;
            currentTop       = diffs + _whiteRect.Location.Y;
            for (int x = 1; x <= 8; x++)
            {
                currentHiddenLeft = _whiteRect.Location.X - diffs;
                currentLeft       = diffs + _whiteRect.Location.X;
                for (int y = 1; y <= 8; y++)
                {
                    z++;
                    DotInfo thisDot = _gameContainer.DotList[z];

                    thisDot.Dot        = SKRect.Create(currentLeft, currentTop, dotSize.Width, dotSize.Height);
                    thisDot.Bounds     = SKRect.Create(currentLeft - (bigHeight.Width / 3), currentTop - (bigHeight.Height / 3), bigHeight.Width, bigHeight.Height);
                    currentLeft       += _spaceHeight;
                    currentHiddenLeft += _spaceHeight;
                }
                currentTop       += _spaceHeight;
                currentHiddenTop += _spaceHeight;
            }
        }
Beispiel #2
0
 private static void InitDots(ConnectTheDotsGameContainer gameContainer)
 {
     gameContainer.DotList = new System.Collections.Generic.Dictionary <int, DotInfo>();
     for (int x = 1; x <= 8; x++)
     {
         for (int y = 1; y <= 8; y++)
         {
             DotInfo thisDot = new DotInfo();
             thisDot.Row    = x;
             thisDot.Column = y;
             gameContainer.DotList.Add(gameContainer.DotList.Count + 1, thisDot);
         }
     }
 }