From 9efa771ad6a4b0123fb2df66a6a63250b0354cce Mon Sep 17 00:00:00 2001 From: grilledham Date: Wed, 16 May 2018 11:38:00 +0100 Subject: [PATCH] updates --- map_gen/presets/test.lua | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/map_gen/presets/test.lua b/map_gen/presets/test.lua index f90356a0..de458b89 100644 --- a/map_gen/presets/test.lua +++ b/map_gen/presets/test.lua @@ -1,16 +1,35 @@ -local b = require "map_gen.shared.builders" +local b = require 'map_gen.shared.builders' +local gb = require 'map_gen.shared.global_builders' +local Token = require('utils.global_token') -local land = b.rectangle(32,16) +local tiles = { + 'grass-1', + 'concrete', + 'dirt-1', + 'stone-path', + 'lab-dark-1', + 'lab-white' +} +local shapes = { + gb.pack(require('map_gen.presets.fruit_loops')), + gb.pack(require('map_gen.presets.creation_of_adam')) +} -local circle = b.circle(4) -local patch = b.resource(b.circle(8), "iron-ore") +local function pattern_func() + local i = math.random(#shapes) + --return gb.tile(tiles[i]) + return shapes[i] +end -local tree = b.entity(circle, "tree-01") +local pt = Token.register(pattern_func) ---[[ local shape = b.apply_entity(land, patch) -shape = b.apply_entity(shape, tree) ]] +local shape = gb.grid_pattern_endless({}, 128, 128, pt) -local shape = b.apply_entities(land, {patch, tree}) +shape = gb.unpack(shape) -return shape \ No newline at end of file +--shape = b.rotate(shape, math.rad(45)) + +--return shape + +return b.rotate(require('map_gen.presets.creation_of_adam'), math.rad(45))