From 0b7a5a8928c2cda6c8c501c1fa194049c587f779 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 8 Jul 2017 04:11:06 -0400 Subject: [PATCH] Make water generate on surface --- map.lua | 5 +++++ player.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/map.lua b/map.lua index d27865c..cb0ad45 100644 --- a/map.lua +++ b/map.lua @@ -24,6 +24,9 @@ earth_max = 2 --max chunks loaded ( chunk x chunk ) max_chunks = 3 +--water height on the surface +water_height = 10 + --makes player move to next map section function maplib.new_block(oldposx,oldposy) if player.playerx < 1 then @@ -189,6 +192,8 @@ function maplib.createmap() --generate dirt as debug if y == yer then tiles[x][y]["block"] = 4 + elseif y < yer and y >= water_height then + tiles[x][y]["block"] = 5 elseif y < yer then tiles[x][y]["block"] = 1 else diff --git a/player.lua b/player.lua index dfdbf5c..00f8ad8 100644 --- a/player.lua +++ b/player.lua @@ -35,7 +35,7 @@ function love.keypressed( key, scancode, isrepeat ) --debug if key == "f5" then - chunkx,chunky = math.random(-1000,1000),math.random(0,3) + chunkx,chunky = math.random(-1000,1000),math.random(2,3) maplib.createmap() --print("generate random block")