diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-12 18:16:06 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-12 18:16:06 -0400 |
commit | 2564533a4860a8452abc27ba05115ca11ed4a787 (patch) | |
tree | 67c5dfb2e892f0d492d977b8a5fa42321f2fa4a5 /Scripts/world.lua | |
parent | 8f0db67c5fdbc1e7b8759f44b45ad64caf336cb5 (diff) |
Ability to pass world data into Lua
Diffstat (limited to 'Scripts/world.lua')
-rw-r--r-- | Scripts/world.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Scripts/world.lua b/Scripts/world.lua index a6224ab..54fcdc0 100644 --- a/Scripts/world.lua +++ b/Scripts/world.lua @@ -20,24 +20,29 @@ world = { Layers = 2, Generate = function(self) math.randomseed(self.Seed) - self.data = {} + --self.data = {} for Z = 0,self.Layers do - self.data[Z] = {} + --self.data[Z] = {} for X = 0,250 do - self.data[Z][X] = {} + --self.data[Z][X] = {} YGen = math.floor(6*math.sin(X/20) + Z) + 64 YDepth = math.random(2,5) for Y = 0,128 do if Y == YGen then - self.data[Z][X][Y] = 0 + --self.data[Z][X][Y] = 0 + self:setData(X, Y, Z, 0); elseif Y < YGen and Y > (YGen - YDepth) then - self.data[Z][X][Y] = 1 + --self.data[Z][X][Y] = 1 + self:setData(X, Y, Z, 1); elseif Y < YGen then - self.data[Z][X][Y] = 2 + --self.data[Z][X][Y] = 2 + self:setData(X, Y, Z, 2); end + --print(X..","..Y..","..Z); end end end + print("Done with world gen"); end } |