Collision help

I have two objects. Ultimately I want this to happen:

When object 1 collides with object 2, I want object 1’s position to transition to object 2’s position over a certain period of time.
How can I accomplish this?

Thanks [import]uid: 42126 topic_id: 8644 reply_id: 308644[/import]

Go Applications > CoronaSDK > SampleCode > Physics > Collision Detection

That will show you how to handle the collision itself.

For moving an object, you can use transition.to.

Here is an example;

[lua]transition.to (object, {time = 1500, x=300, y=300})[/lua]

In that example “object” would move from where it was to the specified coordinates over 1500ms, or 1.5 seconds.

Peach [import]uid: 10144 topic_id: 8644 reply_id: 31605[/import]