Hi everyone,
I am new to Corona SDK and try to realise a game using this SDK but I got stuck implementing a conveyor belt.
What I want to program?
A conveyor belt which transports multiple objects from left to right. If an item is picked up and dragged of the conveyor belt this item should not be influenced anymore from the conveyor belt movement. All other items should move normally from left to right.
It should also be possible to adjust the speed.
What did I try?
So far I tried two possible solutions:
- Detect a collision from an item with the conveyor belt and then start a timer which continously sets a linear velocity to this item.
[lua]object:setLinearVelocity(40, 0)[/lua]
- Detect a collision from an item with the conveyor belt and then start a transition.
[lua]transition.to( collidedObject, { time = 7000, x = 700, y = 0} )[/lua]
Both solutions seemed to me as a not perfect solution. I always have to save the timer or transition for each item and stop only those which was dragged of the conveyor belt.
What do I need from you?
Do you know any better way to implement a conveyor belt? Or do I have to use the above mentioned approach?
Currently it feels very “hacky” to me and I would love to have a more stable implementation.
Thank you very much in advance for your help!
Regards,
Michael