diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-18 12:10:25 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2019-09-18 12:10:25 -0400 |
commit | 0e7f7791fd592f0240a30168a9a570c57b0f5880 (patch) | |
tree | be4e0a598112748030412c452e0a7c24f45ef665 /Scripts/world.lua | |
parent | 145d74e433216f8c17475685c553321ca4cbedf3 (diff) | |
parent | 2cedd39a90fdb0387783b50446b16732517fb651 (diff) |
adjust for world changes
Diffstat (limited to 'Scripts/world.lua')
-rw-r--r-- | Scripts/world.lua | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Scripts/world.lua b/Scripts/world.lua index 8fb3136..044559a 100644 --- a/Scripts/world.lua +++ b/Scripts/world.lua @@ -63,21 +63,27 @@ world = { Generate = function(self) math.randomseed(self.Seed) xsize, ysize, zsize = self:setSize(250, 128, 3) - --self.data = {} for Z = 0,zsize-1 do - --self.data[Z] = {} for X = 0,xsize-1 do - --self.data[Z][X] = {} - YGen = math.floor(6*math.sin(X/20) + Z) + 64 - YDepth = math.random(2,5) + if Z == 0 then + YGen = math.floor(6*math.sin(X/20)) + 64 + elseif Z == 1 then + YGen = math.floor(9*math.sin(X/20)) + 64 + else + YGen = math.floor(15*math.sin(X/20)) + 64 + end + YDepth = math.random(3,5) for Y = 0,ysize-1 do if Y == YGen then self:setData(X, Y, Z, "grass"); elseif Y < YGen and Y > (YGen - YDepth) then self:setData(X, Y, Z, "dirt"); elseif Y < YGen then - --self:setData(X, Y, Z, "stone"); - self:setData(X, Y, Z, "grass"); + self:setData(X, Y, Z, "stone"); + elseif Y == YGen + 1 then + if math.random(0, 100) == 53 then + self:setData(X, Y, Z, "flower"); + end end --print(X..","..Y..","..Z); end |