Skip to content

Instantly share code, notes, and snippets.

@mm-uddin
Created November 24, 2015 06:45
Show Gist options
  • Save mm-uddin/90c9ceeed6416560f13d to your computer and use it in GitHub Desktop.
Save mm-uddin/90c9ceeed6416560f13d to your computer and use it in GitHub Desktop.
//This is run whenever the phone is touched by the user
@Override
protected void actionOnTouch(float x, float y) {
//Increase/decrease the speed of the ball making the ball move towards the touch
mBallSpeedX = 2*(x - mBallX);
mBallSpeedY = 2*(y - mBallY);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment