From be9d14233e9fc7b7c5e4fc3711125132e3cee151 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Tue, 24 Sep 2019 02:29:41 -0400 Subject: Increased texture size for world, made world a little more detailed, and added bouncing ball --- Scripts/world.lua | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'Scripts/world.lua') diff --git a/Scripts/world.lua b/Scripts/world.lua index 044559a..3b56d9a 100644 --- a/Scripts/world.lua +++ b/Scripts/world.lua @@ -13,51 +13,63 @@ world = { texture = { file = "Assets/world.png", offset = { x = 0, y = 0 }, - size = { x = 8, y = 8 } + size = { x = 64, y = 64 } }, normal = { file = "Assets/world_normal.png", offset = { x = 0, y = 0 }, - size = { x = 8, y = 8 } + size = { x = 64, y = 64 } } }); self:registerMaterial("dirt", { texture = { file = "Assets/world.png", - offset = { x = 8, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 64, y = 0 }, + size = { x = 64, y = 64 } }, normal = { file = "Assets/world_normal.png", - offset = { x = 8, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 64, y = 0 }, + size = { x = 64, y = 64 } } }); self:registerMaterial("stone", { texture = { file = "Assets/world.png", - offset = { x = 16, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 128, y = 0 }, + size = { x = 64, y = 64 } }, normal = { file = "Assets/world_normal.png", - offset = { x = 16, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 128, y = 0 }, + size = { x = 64, y = 64 } } }); self:registerMaterial("flower", { texture = { file = "Assets/world.png", - offset = { x = 24, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 192, y = 0 }, + size = { x = 64, y = 64 } }, normal = { file = "Assets/world_normal.png", - offset = { x = 24, y = 0 }, - size = { x = 8, y = 8 } + offset = { x = 192, y = 0 }, + size = { x = 64, y = 64 } }, passable = true }); + self:registerMaterial("trunk", { + texture = { + file = "Assets/world.png", + offset = { x = 256, y = 0 }, + size = { x = 64, y = 64 } + }, + normal = { + file = "Assets/world_normal.png", + offset = { x = 256, y = 0 }, + size = { x = 64, y = 64 } + } + }); end, Generate = function(self) @@ -83,6 +95,8 @@ world = { elseif Y == YGen + 1 then if math.random(0, 100) == 53 then self:setData(X, Y, Z, "flower"); + elseif math.random(0, 100) == 45 then + self:setData(X, Y, Z, "trunk"); end end --print(X..","..Y..","..Z); -- cgit v1.2.3