예제 #1
0
        public void fillMap()
        {
            circle.X = 0;
            circle.Y = 0;


            for (int i = 0; i < 11; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    arr[j, i] = cMap.levelMap.mapArray[j, i];
                }
            }

            pieces = cMap.getInitialPieces();
            Console.WriteLine(pieces.Count);

            foreach (PuzzlePiece item in pieces)
            {
                Sprite2 sprite = new Sprite2(item.getLocX(), item.getLocY(), 60, item);

                sprite.draw(gObject);
            }

            SendToBack();
        }
예제 #2
0
 public CustomMapCreation()
 {
     cMap = new customMapBuilder(1, 1);
     SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
     gp            = new GraphicsPath();
     gObject       = this.CreateGraphics();
     pieceArray    = cMap.getInitialPieces();
     customArr     = new List <PuzzlePiece>();
     invArr        = pieceArray;
     selectedPiece = 30;
     length        = pieceArray.Count;
     sprite1       = new Sprite2[length];
     for (int i = 0; i < length; i++)
     {
         sprite1[i] = new Sprite2(pieceArray[i].getLocX(), pieceArray[i].getLocY(), 60, pieceArray[i]);
     }
     InitializeComponent();
 }