Exemplo n.º 1
0
 void InitBoard()
 {
     for (int i = 0; i < grid.Width / SIZE; i++)
     {
         ColumnDefinition columnDefinitions = new ColumnDefinition();
         columnDefinitions.Width = new GridLength(SIZE);
         grid.ColumnDefinitions.Add(columnDefinitions);
     }
     for (int j = 0; j < grid.Height / SIZE; j++)
     {
         RowDefinition rowDefinition = new RowDefinition();
         rowDefinition.Height = new GridLength(SIZE);
         grid.RowDefinitions.Add(rowDefinition);
     }
     _snake = new MySnake();
 }
Exemplo n.º 2
0
 private void CreateBoard()
 {
     for (int i = 0; i < grid.Width; i++)
     {
         ColumnDefinition columnDefinitions = new ColumnDefinition();
         columnDefinitions.Width = new GridLength(Size);
         grid.ColumnDefinitions.Add(columnDefinitions);
     }
     for (int i = 0; i < grid.Height; i++)
     {
         RowDefinition rowDefinitions = new RowDefinition();
         rowDefinitions.Height = new GridLength(Size);
         grid.RowDefinitions.Add(rowDefinitions);
     }
     Snake = new MySnake();
 }
Exemplo n.º 3
0
        void InitBoard()
        {
            for (int i = 0; i < grid.Width / SIZE; i++ )
            {
                ColumnDefinition columnDefinitions = new ColumnDefinition();
                columnDefinitions.Width = new GridLength(SIZE);
                grid.ColumnDefinitions.Add(columnDefinitions);
            }

            for (int j = 0; j < grid.Height / SIZE; j++)
            {
                RowDefinition rowDefinition = new RowDefinition();
                rowDefinition.Height = new GridLength(SIZE);
                grid.RowDefinitions.Add(rowDefinition);
            }
            _snake = new MySnake();
        }