예제 #1
0
    public Stage(Material[] floors, Material[] walls, FluffBuilder fluff) 
    {
        //FloodFill algorithm needs odd-length grid
        currentLevel = 0; //start level
        levels = new ArrayList();
        spawnedRooms = new ArrayList();
        rooms = new ArrayList();
        this.width = ensureOdd(StageWidths[currentLevel]);
        this.height = ensureOdd(StageHeights[currentLevel]);
        grid = new Tile[this.width, this.height];
        currentRegion = -1;
        int i = RandomizeMaterials(floors.Length);
        this.floorMaterial = floors[i];
        this.wallMaterial = walls[i];
        this.FBuilder = fluff;
        //Initializing the grid to all Rock. Passes materials to Tile as well.
        for (int x = 0; x < this.width; x++)
        {
            for (int y = 0; y < this.height; y++)
            {
                grid[x, y] = new Tile("Rock", new Vector3(x, 0, y),
                 this.floorMaterial, this.wallMaterial);
            }
        }
        savedPlayerPositions = new List<Vector3>();

        spawnExit();

    }
예제 #2
0
 public Stage(Tile[,] loadedGrid, ArrayList loadedRooms, FluffBuilder fluff_builder) {
     levels = new ArrayList();
     spawnedRooms = new ArrayList();
     AddLevel(loadedGrid, loadedRooms);
     FBuilder = fluff_builder;
 }
예제 #3
0
    public Stage(String textfile, Material floor, Material wall, FluffBuilder fbuilder)
    {
        levels = new ArrayList();
        spawnedRooms = new ArrayList();
        grid = ParseTextStage(textfile, floor, wall);
        this.width = grid.GetLength(0);
        this.height = grid.GetLength(1);
        this.floorMaterial = floor;
        this.wallMaterial = wall;
        this.rooms = new ArrayList();
        AddLevel(grid, this.rooms);
        this.FBuilder = fbuilder;

    }