Move object follow finger slide

Hi I’m newbies for corona and I need to create first game similar “paper toss” by moving the object along the path of the finger slide. Anyone have ideas for programming?

Thanks in advance :slight_smile: [import]uid: 58733 topic_id: 11734 reply_id: 311734[/import]

[code]

local object
local fingerTouch
object = display.newRect( 250, 250, 50, 50 )

fingerTouch = function(e)
if e.phase == “moved” then
object.x = e.x
object.y = e.y
end

end
Runtime:addEventListener( “touch”, fingerTouch ) [import]uid: 23063 topic_id: 11734 reply_id: 42731[/import]

Thanks for your support. [import]uid: 58733 topic_id: 11734 reply_id: 42790[/import]

if you want to do some more slowly you can try this

[code]

fingerTouch = function(e)
if e.phase == “moved” then
transition.to( object, { time = 1000, x = e.x, y = e.y } )
end

end

[/code] [import]uid: 23063 topic_id: 11734 reply_id: 42793[/import]

Hi Dhennrich

I’m grateful for your help.
Anyway if i need to move an object follow direction of the finger to the screen by slide your finger to the west, a distance of 3 cm and then take your finger off. After moving to 3 cm, if i need to an object moves in the same direction to the end of the screen should I do? [import]uid: 58733 topic_id: 11734 reply_id: 42827[/import]