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 :slight_smile: ))

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.

belt

This is a little of my game, but the rock are only move as a bulls#!t :slight_smile: 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 :slight_smile:

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 :slight_smile: 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
Runtime:addEventListener(“enterFrame”, dirtAndBelt)

local function onCollision(event)
if event.object1.objtype == “belt” and event.object2.objtype == “dirt” then
dirtNmbr[event.object2.numbr] = event.object1.numbr
end
end
Runtime:addEventListener( “collision”, onCollision )

Hey @tim.geiges, look what I found: https://coronalabs.com/blog/2014/01/07/tutorial-moving-objects-along-a-path/
It’s an old resource but it seems to deal with what you wanted to achieve without using physics.

I’m not saying you shouldn’t use collision events - you absolutely should if that works for you! But I think you might be interested nonetheless.

Thank you very much jedihenryk, I am going to run a test of that type, this is better as I did not really want to mess with all of physics :slight_smile: there will be some physics a bit :slight_smile:thank you again, I’ll try this soon!