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:
Kayne Ruse
2014-07-02 00:47:37 +10:00
parent 8ed308e89a
commit 93480be685
7 changed files with 53 additions and 13 deletions
+6 -3
View File
@@ -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