Here’s parts of my code in the main collection:
function init(self)
--[[ set up the plumbing ]]--
self.board_id = hash("/board")
msg.post(".", "acquire_input_focus")
end
board
is a GO defined in the main collection, so I assume there’s no need to create or delete it manually
Then I have this part:
local function handle_collision(self, obj_id)
local children = get_children_go(self, obj_id)
for _, child_id in ipairs(children) do
go.set_parent(child_id, self.board_id)
end
go.delete(obj_id)
end
called for a collision, so that all child objects are parented under board
.
Should I delete all the child objects I set board
as a parent in final()
or they will be deleted as its children automatically ?