Exemple #1
0
 public MapGenerator()
 {
     l = new LayeredNoise(6, 0.5, 0, 0.01, noise);
 }
Exemple #2
0
 private double edgeDropOff(double i, double j)
 {
     double dx = i - Width / 2;
     double dy = j - Height / 2;
     if (dx < 0)
         dx *= -1;
     if (dy < 0)
         dy *= -1;
     double f1 = ((double)dx / (double)(Width / 2));
     double f2 = ((double)dy / (double)(Height / 2));
     switch (Drop)
     {
         case DropoffType.FLAT:
             double l = (1.0 - f1) * (1.0 - f2);
             return Math.Pow(l, 3.0 / (EdgyNess));
         case DropoffType.ROUND:
             l = Math.Sqrt(f1 * f1 + f2 * f2);
             return 1.0 - Math.Pow(l, EdgyNess);
         default:
             return 0;
     }
 }