I want to be able to hold, drag and catapult an object from a corner of the screen to the opposite corner at an angle and speed from my drag. Download the #1 game on the Apple Store to see what I mean.
Copying Tetrad's comment since he didn't post it as an answer...
Well you usually have some position in the world that your sling shot is in (
Then your drag will move your projectile to some other position in the world (
Subtract these two vectors to get a new vector from the projectile to the sling shot:
Use the vector's direction to set the force direction, and the magnitude to set the force amount (where further away is higher force magnitude, obviously). Actually you can do that just by setting the force directly to the vector, possibly with a multiplier:
From there's it's usually a matter of just making sure your physics properties are set up right. More info here:
answered Jun 07 '10 at 03:00 PM
I know how to drag the object but what would be the best way to calculate the force and angle based on the position of the drag. Again Im an artist, so Im giving it my best shot. I will post my code here very soon ...
answered Jun 05 '10 at 03:46 PM