Skip to content

Instantly share code, notes, and snippets.

@Quit
Created April 2, 2015 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quit/a09b47b7c1e2af7c72fe to your computer and use it in GitHub Desktop.
Save Quit/a09b47b7c1e2af7c72fe to your computer and use it in GitHub Desktop.
local World = class()
local function create_conveyor(x, z, rot, resource)
local ent = microworld:place_entity(radiant.util.get_config('conveyor_reference'), x, z, { full_size = true, owner = microworld:get_local_player_id() })
radiant.entities.turn_to(ent, rot)
if resource then
radiant.events.listen_once(radiant, 'stonehearth:gameloop', function()
resource = radiant.entities.create_entity(resource, { owner = microworld:get_local_player_id() })
ent:add_component(radiant.util.get_config('conveyor_component_name')):place_entity(resource)
end)
end
return ent
end
local function poof()
microworld:place_entity('stonehearth:resources:wood:oak_log', 4, -4, { full_size = false, owner = microworld:get_local_player_id() })
end
function World:start()
microworld:create_world(64)
microworld:place_citizen(5, 0)
local owner = microworld:get_local_player_id()
jelly_console.add_command('poof', poof)
local adam = create_conveyor(0, 0, 0)
create_conveyor(0, 4, 180)
create_conveyor(0, 8, 0)
create_conveyor(0, 12, 0)
microworld:place_stockpile(2, 18, 4, 4)
poof()
end
return World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment