Compare commits

...

10 Commits

Author SHA1 Message Date
teverse cdb0134b41 dealloc 2020-02-05 22:31:12 +00:00
teverse aceca964c8 nil cjeckl 2020-02-05 22:23:03 +00:00
teverse e38836dad8 server 2020-02-05 21:23:28 +00:00
teverse 03e2e981c0 light 2020-02-05 21:19:37 +00:00
teverse 2e74f88798 fsdfsdf 2020-02-05 21:18:12 +00:00
teverse 24c710baf7 commit spam 2020-02-05 21:15:30 +00:00
teverse e8ca464058 yrdy 2020-02-05 21:13:59 +00:00
teverse bb8bf31c16 test 2020-02-05 21:13:07 +00:00
teverse 959f05c0fc test 2020-02-05 21:02:32 +00:00
teverse 3858d06826 0.17.1 2020-02-05 20:56:57 +00:00
2 changed files with 46 additions and 36 deletions

View File

@ -15,7 +15,7 @@ local function registerBlock(c)
if c.className == "block" then if c.className == "block" then
c:once("mouseLeftPressed", function () c:once("mouseLeftPressed", function ()
if c.size == vector3(4, 4, 4) then if c.size == vector3(4, 4, 4) then
print("mining", c.position.x/4, c.position.y/4, c.position.z/4) --print("mining", c.position.x/4, c.position.y/4, c.position.z/4)
engine.networking:toServer("mineBlock", c.position.x/4, c.position.y/4, c.position.z/4) engine.networking:toServer("mineBlock", c.position.x/4, c.position.y/4, c.position.z/4)
end end
end) end)

View File

@ -13,35 +13,43 @@ local mainLight = engine.construct("light", workspace, {
position = vector3(3, 2, 0), position = vector3(3, 2, 0),
type = enums.lightType.directional, type = enums.lightType.directional,
rotation = quaternion():setEuler(math.rad(66), 0, 0), rotation = quaternion():setEuler(math.rad(66), 0, 0),
diffuseColour = colour(1, 1, 1),
specularColour = colour(1, 1, 1)
})
local pointLight = engine.construct("light", workspace, {
name = "pointLight",
position = vector3(0, 1, 0),
type = enums.lightType.point,
diffuseColour = colour(10, 10, 10), diffuseColour = colour(10, 10, 10),
specularColour = colour(10, 10, 10) radius = 20
}) })
engine.construct("block", workspace, { engine.construct("block", workspace, {
name = "base", name = "base",
position = vector3(-72, 2, 0), position = vector3(-72, 2.25, 0),
size = vector3(100, 0.5, 100), size = vector3(100, 0.5, 44),
colour = colour:fromRGB(75, 163, 57) colour = colour:fromRGB(75, 163, 57)
}) })
engine.construct("block", workspace, { engine.construct("block", workspace, {
name = "base", name = "base",
position = vector3(72, 2, 0), position = vector3(72, 2.25, 0),
size = vector3(100, 0.5, 100), size = vector3(100, 0.5, 44),
colour = colour:fromRGB(75, 163, 57) colour = colour:fromRGB(75, 163, 57)
}) })
engine.construct("block", workspace, { engine.construct("block", workspace, {
name = "base", name = "base",
position = vector3(0, 2, 72), position = vector3(0, 2.25, 72),
size = vector3(100, 0.5, 100), size = vector3(200, 0.5, 100),
colour = colour:fromRGB(75, 163, 57) colour = colour:fromRGB(75, 163, 57)
}) })
engine.construct("block", workspace, { engine.construct("block", workspace, {
name = "base", name = "base",
position = vector3(0, 2, -72), position = vector3(0, 2.25, -72),
size = vector3(100, 0.5, 100), size = vector3(200, 0.5, 100),
colour = colour:fromRGB(75, 163, 57) colour = colour:fromRGB(75, 163, 57)
}) })
@ -71,7 +79,7 @@ local function fillSpace(x, y, z)
-- If we dont set the space as used, it will not be mineable... -- If we dont set the space as used, it will not be mineable...
-- Use this to our advantage to set a boundary -- Use this to our advantage to set a boundary
if x < 20 and x > -20 and y > -20 and z > -20 and z < 20 then if x < 40 and x > -40 and y > -50 and z > -40 and z < 40 then
setSpaceUsed(x, y, z, block) setSpaceUsed(x, y, z, block)
else else
-- this block is not minable, let's make it look different? -- this block is not minable, let's make it look different?
@ -102,6 +110,7 @@ engine.networking:bind( "mineBlock", function( client, x, y, z )
if type(x) == "number" and type(y) == "number" and type(z) == "number" and isSpaceUsed(x, y, z) then if type(x) == "number" and type(y) == "number" and type(z) == "number" and isSpaceUsed(x, y, z) then
local block = minable[x][y][z] local block = minable[x][y][z]
if block then
setSpaceUsed(x, y, z, true) setSpaceUsed(x, y, z, true)
if not isSpaceUsed(x, y - 1, z) then if not isSpaceUsed(x, y - 1, z) then
@ -130,6 +139,7 @@ engine.networking:bind( "mineBlock", function( client, x, y, z )
block:destroy() block:destroy()
end end
end
end) end)
print("server loaded") print("server loaded")