I’m an animator with some web scripting experience recently converted to game coding thanks to Corona.
I’m still experimenting with a lot of the API and got stuck with one problem: how would you approach controlling an object not by dragging but “flicking it”? I have this rigid body object and I want the flick of my finger to push it away…
use the touch event, check the time on the “began” phase, determine the speed at which it hits your object by measuring the distance and time at your point of collision, then apply a relative force based on this speed with something like this: http://developer.anscamobile.com/reference/index/bodyapplyforce
I can start my touch session anywhere on the screen. From the starting point to where my touch ends, I want to calculate if that line is intersecting any object.
Man, I should have really paid more attention to math back in school eheheh [import]uid: 12335 topic_id: 5059 reply_id: 17057[/import]