Look at the comment.
function init(self)
msg.post(".", "acquire_input_focus")
totalBalls = 0
end
function on_input(self, action_id, action)
if action_id == hash("leftclick") then
if action.pressed then
totalBalls = totalBalls + 1
factory.create( "#balls", vmath.vector3(action.x, action.y, 0), nil, nil, vmath.vector3(0.5, 0.5, 1) )
print("Total balls:",totalBalls)
end
elseif action_id == hash("rightclick") then
if action.pressed then
factory.create( "#collision", vmath.vector3(action.x, action.y, 0) )
--
-- I want to remove whatever gameobject this
-- newly created gameobject touches,
-- but need to get the collision message for
-- that. How would I do this?
--
end
end
end
--function on_message(self, message_id, message)
--end