|
What I have is the following:
1) A ball with physics enabled.
2) A polyline level
3) Physics/Collision detection works fine between those
What I want:
Swiping the ball by X amount in the X direction would move the ball by X amount in the X direction WHILE maintaining Y physics and collision physics. Which means that if you swipe the ball right 100 pixels, but after 50 pixels there is a wall, then the ball would just move 50 pixels to the right.
Another example: Say you want the ball to go up a hill to the right, you would swipe to the right and the ball's change in X position would equal to the finger's delta X. So the ball is going up the hill in X direction and also in Y due to the ball's reaction to the slope of the hill (3. physics/collision detection)
I have recently become aware of the TouchPanel drag gesture.Delta() function and making use of it but it doesn't feel right.
I would really appreciate help on this.
Thanks, Tan.
|