Hi Im just trying to create a flick effect, I have experimented with transition:to and this kind of does the effect I want but not in a physics sense. I want the object when swiped in a direction to have force applied in that direction , if it hits a obstacle then acts appropriately e.g. bouncing off the obstacle.
Heres an example to work from, I want to be able to flick in the direction of the event:
Many thanks.
[code]
physics = require(“physics”)
physics.start()
physics.setScale(50)
physics.setGravity(0,0)
local player = display.newRect(0,0, 40, 40)
player.x = 200
player.y = 200
physics.addBody( player, { density = 1.0, friction = 0.3, bounce = 0.2 } )
Runtime:addEventListener(“touch”, function( event) --Add some touch listeners to the player–
–player.x = event.x –
–player.y = event.y – this moves object to location
– player:applyLinearImpulse( 1, 1, player.x, player.y ) – how do I get same as below with impulse
transition.to( player, { time=1500, x=event.x, y=event.y} )
end )
[/code] [import]uid: 118379 topic_id: 21816 reply_id: 321816[/import]

[import]uid: 52491 topic_id: 21816 reply_id: 86860[/import]