Skip to content

Instantly share code, notes, and snippets.

@railsstudent
Last active August 29, 2015 13:57
Show Gist options
  • Save railsstudent/9446641 to your computer and use it in GitHub Desktop.
Save railsstudent/9446641 to your computer and use it in GitHub Desktop.
@Override
protected void actionOnTouch(float x, float y) {
//Increase/decrease the speed of the ball making the ball move towards the touch
mBallX = x;
mBallY = y;
// mBallSpeedX = x - mBallX;
// mBallSpeedY = y - mBallY;
mBallSpeedX = (x - mBallX) * 2;
mBallSpeedY = (y - mBallY) * 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment