-
-
Save Quit/a09b47b7c1e2af7c72fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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