Ejemplo n.º 1
0
    public override void generate()
    {
        clearTo(AsciiMapSymbols.WALKABLE); // SET IT ALL TO (WALKABLE) TO START

        int numRooms = Mathf.Max(width / 10, height/10);
        int maxRoomSize = numRooms - 2;
        int minRoomSize = 3;

        maxRoomSize = Mathf.Clamp(maxRoomSize, minRoomSize, maxRoomSize);

        PseudoLinearLevel psl =
                new PseudoLinearLevel((uint)width,(uint)height,(uint)numRooms,
                                        (uint)minRoomSize,(uint)maxRoomSize,
                                        (uint)minRoomSize,(uint)maxRoomSize,
                                        1,1,r,4); //This line isn't really useful but has to be here

        createStartingDungeonMap(psl);

        RandomFill(-1, AsciiMapSymbols.WALKABLE, r.getIntInRange(15,25));

        OutlineMap(BASELAYER,AsciiMapSymbols.MOUNTAIN); // Outline the map with a blocking or warping tile

        placeTreasure(r.getIntInRange(1,numRooms/2), 4, psl); // UPDATE THIS TO TAKE ADVANTAGE OF THE PSL INFORMATION

        placeExitArea(r.getIntInRange(4,6)); //The start is a safe zone.

        //SET THE COLOR FOR THE ASCII TEXT THING
        UColor.HSL theMainColor = new UColor.HSL((float)r.getRandom(),0.7f,0.3f); //Choose a main color
        MainColor = theMainColor.toColor();

        md = new AsciiMapSymbols(LevelData.TYPE_CAVE, MainColor);

        base.generate();
    }
Ejemplo n.º 2
0
    public static Color RandomColor(RandomSeed r = null)
    {
        if (r == null)
        {
            r = new RandomSeed(DateTime.Now.Millisecond);
            Debug.Log("Ucolor.cs got a broken random seed request.");
        }

        UColor.HSL theColor = new UColor.HSL((float)r.getRandom(), 0.7f, 0.8f); //Choose a  color
        Color      color    = theColor.toColor();

        return(color);
    }//RandomColor
Ejemplo n.º 3
0
    public LevelData(int width,int height, double seed, int theType)
    {
        this.seed = seed;
        r = new RandomSeed(seed);

        //SET THE COLOR FOR MY ASCII TEXT THING
        UColor.HSL theMainColor = new UColor.HSL((float)r.getRandom(),0.7f,0.3f); //Choose a main color
        MainColor = theMainColor.toColor();

        this.width = width;
        this.height = height;
        type = theType;
        md = new AsciiMapSymbols(type, MainColor);
        astar = new AStar(this.width, this.height);

        this.startLocation = new Vector2(width/2, height/2);
        this.parentStartLocation = startLocation;
        clearTo(0);
    }
Ejemplo n.º 4
0
    public static Color RandomColor(RandomSeed r = null)
    {
        if(r == null)
        {

            r = new RandomSeed(DateTime.Now.Millisecond);
            Debug.Log("ForestOverworldLevel.cs got a broken random seed request.");
        }

        //SET THE COLOR FOR MY ASCII TEXT THING
        UColor.HSL theMainColor = new UColor.HSL((float)r.getRandom(),0.7f,0.3f); //Choose a main color
        Color color = theMainColor.toColor();
        return color;
    }