Beispiel #1
0
    private void GeneratePipes()
    {
        bool[,] field = new bool[_height, _lenght];
        List <string> path = _djikstra.BuildRandomPath(_height, _lenght);

        Vector2    startPosition = new Vector2((_lenght - 1) * _step / 2 * -1, (_height - 1) * _step / 2);
        Vector2    position;
        Quaternion rotation = new Quaternion();

        position = InstatiateBeginAndEnd(path, startPosition, ref rotation);

        field[0, 0] = true;
        field[_height - 1, _lenght - 1] = true;

        InstatiatePath(field, path, ref position, ref rotation);
        Pp(field);
        position = FillEmptyWithPipes(field, position, rotation);
    }