Esempio n. 1
0
        private static Vector2 GetRandomValidPosition()
        {
            int x = random.Next(MapTiles.GetLength(0));
            int y = random.Next(MapTiles.GetLength(1));

            while (MapTiles[x, y] == 0 || !(EntityManager.OccupiedTiles[x, y] == null))
            {
                x = random.Next(MapTiles.GetLength(0));
                y = random.Next(MapTiles.GetLength(1));
            }

            return(new Vector2(x, y));
        }