Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(walkto) {
- var times = Math.floor((DrawTime - LastMove) / (1000 / me.speed));
- if(times > 100000 || times < 0)
- times = 0;
- var process = (DrawTime - LastMove) % (1000 / me.speed) / (1000 / me.speed);
- if(typeof(path[times]) == 'undefined') {
- me.position.coordinates = path[path.length - 1];
- }else{
- me.position.coordinates = path[times];
- }
- }
- 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));
- 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));
- 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)));
- 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)));
- if(times) {
- LastMove = DrawTime + (DrawTime - LastMove) % (1000 / me.speed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement