Guest User

Untitled

a guest
Nov 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. private void interpolate(float interpolation){
  2. xAccum += xSpeed * interpolation;
  3. yAccum += ySpeed * interpolation;
  4.  
  5. if(xAccum >= 1 || xAccum <= 1){
  6. xPos += (int)xAccum;
  7. xAccum -= (int)xAccum;
  8. }
  9.  
  10. if(yAccum >= 1 || yAccum <= 1){
  11. yPos += (int)yAccum;
  12. yAccum -= (int)yAccum;
  13. }
  14.  
  15. bound.setBounds(xPos, yPos, 20, 20);
  16.  
  17. }
Add Comment
Please, Sign In to add comment