private void MakeFood() { _target = GetRandomFreeCell(); _target.IsFood = true; _target.Label.Background = new SolidColorBrush(Colors.DarkRed); _snake.TargetPosition = _target.Position; }
public CellIdentity[,] GenerateCells(int x = 10, int y = 10) { CellIdentity[,] output = new CellIdentity[x, y]; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { output[i, j] = new CellIdentity(i, j); } } return(output); }