When this bit of code is triggered, the message gets sent several times. Does it need to be cleared somehow? Mouse left click is mapped to action “thump”.
Also, is there some equivalent to pointer_over() for sprites etc or is manual checking as below the only way?
function on_input(self, action_id, action)
-- if clicked over ringo, send ringo a message
if action_id == hash("thump") then
local rpos = go.get_position("ringo")
if math.abs(rpos.x - action.x) < 20 and math.abs(rpos.y - action.y) < 20 then
msg.post("ringo#ringoprog", "biff")
end
end
end