Advertisement
Guest User

thx

a guest
Aug 28th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. if(walkto) {
  2.     var times = Math.floor((DrawTime - LastMove) / (1000 / me.speed));
  3.     if(times > 100000 || times < 0)
  4.         times = 0;
  5.     var process = (DrawTime - LastMove) % (1000 / me.speed) / (1000 / me.speed);
  6.     if(typeof(path[times]) == 'undefined') {
  7.         me.position.coordinates = path[path.length - 1];
  8.     }else{
  9.         me.position.coordinates = path[times];
  10.     }
  11. }
  12. var animationleft = ((me.position.rotation == 0 || me.position.rotation == 1 || me.position.rotation == 2) ? process : ((me.position.rotation == 4 || me.position.rotation == 5 || me.position.rotation == 6) ? -process : 0));
  13. var animationtop = ((me.position.rotation == 2 || me.position.rotation == 3 || me.position.rotation == 4) ? process : ((me.position.rotation == 6 || me.position.rotation == 7 || me.position.rotation == 0) ? -process : 0));
  14. me.position.pixels[0] = Math.floor(map[me.position.coordinates[1]][me.position.coordinates[0]].left + animationleft * (32 * ((me.position.rotation%2==1) ? 2 : 1)));
  15. me.position.pixels[1] = Math.floor(map[me.position.coordinates[1]][me.position.coordinates[0]].top + animationtop * (16 * ((me.position.rotation%2==1) ? 2 : 1)));
  16. if(times) {
  17.     LastMove = DrawTime + (DrawTime - LastMove) % (1000 / me.speed);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement