I have a question about a ball game i am making.
captain-cheesy
Member Posts: 7
I was wondering how to make it so that when you tap on the ball; what ever angle your finger hits the ball at, the ball goes off at that angle and not just in a straight line.
Best Answer
-
Fajlajp Posts: 666I think you mean flick movement. This is how to. (This will also have the speed depending on your swipe speed,but that's is just optinal)
Use the "change velocity" behaviour in the ball actor.
In dirrection you do:(
(self.position.x-mouse.position.x,self.position.y-mouse.position.y)
-In speed you do : (You could enter the speed you want if you don't want the speed to be depending on the swipe speed)
magnitude(self.position.Y,mouse.positionY)*3
now the *3 can be adjusted to the power you like for your game
That should work,but I haven't test it.
Answers
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮