diff --git a/scenes/startup.tscn b/scenes/startup.tscn index dc53e1f..8c0724e 100644 --- a/scenes/startup.tscn +++ b/scenes/startup.tscn @@ -255,7 +255,7 @@ margin_top = 36.0 margin_right = 289.0 margin_bottom = 64.0 text = "Forest" -items = [ "Forest", null, false, 0, null, "Desert", null, false, 1, null, "Boreal", null, false, 2, null ] +items = [ "Forest", null, false, 0, null, "Desert", null, false, 1, null, "Boreal", null, false, 2, null, "Cave", null, false, 3, null ] selected = 0 [node name="DeleteConfirmation" type="ConfirmationDialog" parent="."] diff --git a/scripts/game/chunk_generators/CaveGenerator.gd b/scripts/game/chunk_generators/CaveGenerator.gd new file mode 100644 index 0000000..447b69f --- /dev/null +++ b/scripts/game/chunk_generators/CaveGenerator.gd @@ -0,0 +1,16 @@ +extends ChunkGenerator + + +static func generate_surface(height, _x, y, _z): + var type + if y == height - 1: + type = "Grass" + elif y == height -2: + type = "Dirt" + elif y == height - 3 or y == height - 4: + type = "Stone" + elif y < height - 14: + type = "Stone" + else: + type = "Air" + return type