Something like this:
local object1 = display.newRect(100, 100, 50, 50) --means object1.x = 100
local object2 = display.newRect(200, 100, 50, 50) --means object2.x = 200
–During the objects dragging:
local function positionCheck ()
if (rawequal (object1.x, object2.x) then
transition.to (object1, {time=1500, x = object1.x - 50})
transition.to (object2, {time=1500, x = object2.x + 50})
end
end
In common, is it possible whithout “physics” library?
Thank you for some words to clarify it.
Yuriy