First biome based generator iteration

This commit is contained in:
Shoghi Cervantes
2015-01-07 04:07:11 +01:00
parent 37fd0372cc
commit a76be6cf38
11 changed files with 274 additions and 57 deletions

View File

@ -23,7 +23,7 @@ namespace pocketmine\level\generator\noise;
use pocketmine\utils\Random;
class Perlin extends Generator{
class Perlin extends Noise{
public static $grad3 = [
[1, 1, 0], [-1, 1, 0], [1, -1, 0], [-1, -1, 0],
[1, 0, 1], [-1, 0, 1], [1, 0, -1], [-1, 0, -1],
@ -31,9 +31,10 @@ class Perlin extends Generator{
];
public function __construct(Random $random, $octaves, $frequency, $amplitude){
public function __construct(Random $random, $octaves, $frequency, $amplitude, $lacunarity){
$this->octaves = $octaves;
$this->frequency = $frequency;
$this->lacunarity = $lacunarity;
$this->amplitude = $amplitude;
$this->offsetX = $random->nextFloat() * 256;
$this->offsetY = $random->nextFloat() * 256;