Solid data is moving from the server to the client, read more
The APIs have access to the solid data, and I fixed a bug: Basically, the template parameter for std::bitset expects an integer representing the number of bits to hold, but I initially misread it as the number of bytes. This has been corrected. I've also added a sandy beach to the generated island. I'm tempted to start working on some simple generators soon.
This commit is contained in:
@@ -19,10 +19,13 @@ Region.OnCreate = function(region)
|
||||
local ret = Region.hcOnCreate(region) --best practices
|
||||
for i = 1, Region.GetWidth() do
|
||||
for j = 1, Region.GetHeight() do
|
||||
if distance(0, 0, i + Region.GetX(region) -1, j + Region.GetY(region) -1) > 10 then
|
||||
Region.SetTile(region, i, j, 1, water)
|
||||
else
|
||||
local dist = distance(0, 0, i + Region.GetX(region) -1, j + Region.GetY(region) -1)
|
||||
if dist < 10 then
|
||||
Region.SetTile(region, i, j, 1, plains)
|
||||
elseif dist < 12 then
|
||||
Region.SetTile(region, i, j, 1, sand)
|
||||
else
|
||||
Region.SetTile(region, i, j, 1, water)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user