# how to move and turn, from other images by them self

So I was wondering if anyone knows something small about moving some image dragging another. So basically I just need to move and image then turns when touches the necked image that turns to another.

Like is there a way if a rock on a belt going (north)y- to go up, then if it touches another belt that wants to change (east)x+

(Sorry if I sound strange, my stroke sucks and it is hard for me to right it really clear, but I can tell thing from Lua (A bit ))

would it need to be using physics to move the rock under the belt or is there something that can do that from something else to touch rock on belt.

This is a little of my game, but the rock are only move as a bulls#!t so I donâ€™t know what can touch from another

If you donâ€™t want to use physics then I think the solution is to approach the problem from a different perspective.
You already have some object that represent conveyor belt, develop that. Make the belt aware how much material it carries, how fast and what itâ€™s connected to (i.e. other belt).

One solution I see: when conveyor receives material you call some method that tell is to translate the material object to the other side and then call the same method on the connected belt.

``````function belt:push(material)
-- material is some display object, we can use transitions to animate it's movement
local targetX, targetY = -- these depend on belt's length and direction :)
transition.to(
material,
{
x = targetX,
y = targetY,
onComplete = function() self.nextBelt:push(material) end
})
end
``````

Iâ€™ll gladly see other solutions, but I hope this at least inspires you somewhat

Thank you, I was not able to figure out of the (function belt:push(material)
)

I did get some of the physics a bit
it works pretty dang good, Iâ€™ll change then x y +/-
but I hope it is good Thank you again

dirtNmbr = {}
local function dirtAndBelt(event)
for k,v in pairs(dirtNmbr) do
dirtMove[k].x = belt[v].x
dirtNmbr[k] = nil
end
for k=1,#dirtMove do
dirtMove[k].y = dirtMove[k].y + .25
end
end

local function onCollision(event)
if event.object1.objtype == â€śbeltâ€ť and event.object2.objtype == â€śdirtâ€ť then
dirtNmbr[event.object2.numbr] = event.object1.numbr
end
end