- Home /
How To Make Ball Bounce On Touch
Hi,
I need some help. I am making an android game in which the user has to touch the screen to get the ball to jump. For example if the screen is touched twice the ball jumps 1x higher than the first time it was touched.
And another problem I have is that when the ball is on the ground it rolls until the user touches the screen for it to bounce. How would I get the ball to roll and bounce when the screen is touched
Thanks Your Help Is Much Appreciated
Answer by koray1396 · Apr 22, 2014 at 04:11 PM
things to do:
Check input of touches
if there is any touch, apply force to the ball, or change velocity...
create a system for double touch, how will it work, such as the period between two touches will not exceed 0.2s.
so if it's double touch do normal jump, otherwise do big jump
if there is no input, rotate the ball and move the ball on a constant speed