Hey! I am a beginner, and trying to do this for many days :roll:.I am making a kind of a shooting game. I want that the player will drag the ball and as much the ball is dragged the quantity of force increases to shoot. The ball will go in the direction given by the user, same as happens in angry birds when we throw the bird on blocks. Can some body help ? please any help will be appreciated.
I have attached the images so that you may easily understand what I want to do…
you would have to;
- on mouse button down get the co-ordinate on screen
- then on mouse button up get the second co-ordinate on screen
- find the distance from one to the other by taking one co-ordinate from the other
- find also the direction (rotation) from the first point to the second point and find its opposite
- use the distance from the 2 points as the force for the ball
- rotate the ball depending on the opposite direction of the 2 points
- now add gravity to the ball after it is fired
try possibly using:
and
spot on… good answer +1