Exemple #1
0
    public void CreateRulesAndTemplates()
    {
        List <Rule> montain = new List <Rule>()
        {
            new Rule {
                spritePath = "Mountain/tierra_nieve", spriteMultiplePath = "", isDefault = true, isMultipleSprite = false, matrixOfNeighbors = new int[, ] {
                    { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }
                }
            }, new Rule {
                spritePath = "Mountain/nieve", spriteMultiplePath = "", isDefault = false, isMultipleSprite = false, matrixOfNeighbors = new int[, ] {
                    { 0, -1, 0 }, { 1, 0, 1 }, { 0, 0, 0 }
                }
            }, new Rule {
                spritePath = "Mountain/nieve_left", spriteMultiplePath = "", isDefault = false, isMultipleSprite = false, matrixOfNeighbors = new int[, ] {
                    { 0, -1, 0 }, { -1, 0, 1 }, { 0, 0, 0 }
                }
            }, new Rule {
                spritePath = "Mountain/nieve_right", spriteMultiplePath = "", isDefault = false, isMultipleSprite = false, matrixOfNeighbors = new int[, ] {
                    { 0, -1, 0 }, { 1, 0, -1 }, { 0, 0, 0 }
                }
            }
        };

        RuleTileGenerator.CreateRuleTile("montain", montain);
        templates["cueva1"] = new Template {
            seed = 76.699096F, filler = "montain", requiredFloorPercent = 45, algorithm = "RandomWalkCave"
        };
        templates["cueva2"] = new Template {
            seed = 3569.236096F, filler = "montain", requiredFloorPercent = 45, algorithm = "RandomWalkCave"
        };
        templates["camino1"] = new Template {
            seed = 66.368077F, filler = "montain", algorithm = "RandomWalk"
        };
        templates["camino2"] = new Template {
            seed = 76.699096F, filler = "montain", algorithm = "RandomWalk"
        };
        templates["camino3"] = new Template {
            seed = 7653.090956F, filler = "montain", algorithm = "RandomWalk"
        };
        templates["camino4"] = new Template {
            seed = 67.975635F, filler = "montain", algorithm = "RandomWalk"
        };
        templates["completo"] = new Template {
            fillPercent = 100, filler = "montain", algorithm = "MooreCellularAutomata"
        };
    }
Exemple #2
0
 public void GenerateAllRuleTiles()
 {
     Debug.Log("Generating Rule Tile");
     RuleTileGenerator.CreateAllRuleTiles();
 }