Exemple #1
0
    public override void GenerateContent()
    {
        base.GenerateContent();

        Generator gen = new Generator();

        puzzleGrid = gen.GeneratePuzzle(puzzleGrid.GridSize, (int)puzzleDifficulty);

        IntPair offset = new IntPair(RoomWidth / 2 - puzzleGrid.GridSize.x / 2,
                                     RoomHeight / 2 - puzzleGrid.GridSize.y / 2);

        for (int i = 0; i < puzzleGrid.GetArrayLength(); i++)
        {
            IntPair pos = puzzleGrid.GetPosition(i);

            bool flipped = puzzleGrid.IsFlipped(i);
            DungeonRoomObject tileLight = new DungeonRoomObject(this,
                                                                pos + offset, "FlipTile", i, false);
            roomObjects.Add(tileLight);
        }
    }