simple touch and drag with velocity

I was wondering if anyone can point me towards a thread or example which involves ‘flicking’ or ‘flinging’ a simple physics object. The key would be the velocity and angle of the drag Im guessing but would like a simple starting point to work from.

My searches through threads seem to only reference touch or dragging but Im sure something must be tucked away here somewhere.

thx in advance! [import]uid: 42417 topic_id: 16890 reply_id: 316890[/import]

Have you tried the different physics bodies. Some react to the motion of your touch. So if you try flinging it across the screen the object will move with regard to the velocity and force you gave it. [import]uid: 54716 topic_id: 16890 reply_id: 63314[/import]

It seems that a kinematic body type is recommended in the docs but it also seems that negates using collisions. Is it doable as a dynamic body type?
[import]uid: 42417 topic_id: 16890 reply_id: 63319[/import]

get the start co-ordinate, get the end co-ordinate of the touch and the time, the dX and the dY will give you the movement and the dTime between the start and the end. you can now determine the acceleration and if you want, even the direction, apply a force (linearImpulse) accordingly…

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16890 reply_id: 63482[/import]

Not sure if this is quite what you’re after or not but it is well worth checking out if you haven’t already;

Applications > CoronaSDK > SampleCode > Physics > MultiPuck

Peach :slight_smile: [import]uid: 52491 topic_id: 16890 reply_id: 63735[/import]

Hi I have a game where the user is sliding tiles around on a grid so the movement must be restricted to horiz/vert and the start and end points are known prior to touch, just not the velocity.

I was hoping to find an example of something like this that does not use the physics engine, only because I don’t think I need physics to accomplish this but I do want it to feel natural so slow flick and fast flick feel different and on a fast flick it is very responsive. [import]uid: 111413 topic_id: 16890 reply_id: 114799[/import]