Skip to content

anonymous /interpolate.java
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Interpolation
private void interpolate(float interpolation){
xAccum += xSpeed * interpolation;
yAccum += ySpeed * interpolation;
if(xAccum >= 1 || xAccum <= 1){
xPos += (int)xAccum;
xAccum -= (int)xAccum;
}
if(yAccum >= 1 || yAccum <= 1){
yPos += (int)yAccum;
yAccum -= (int)yAccum;
}
bound.setBounds(xPos, yPos, 20, 20);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.