Advertisement
Guest User

Untitled

a guest
May 29th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. MyRobot.prototype.update=function(currTime){
  2.  
  3. if (this.lastUpdate == -1)
  4. this.lastUpdate = currTime;
  5. var diff = currTime - this.lastUpdate;
  6.  
  7. if (this.handMove != 0)
  8. {
  9. if (this.tempXRot == 999 && this.tempZRot == 999)
  10. {
  11. this.tempXRot = -this.armRotation;
  12. this.tempZRot = 0;
  13. }
  14. else if (this.tempXRot <= -165 && this.movementPart != 4)
  15. {
  16. if (this.tempZRot > -20 && this.movementPart == 0)
  17. this.tempZRot -= diff * (360 / (60 * 100));
  18. else if (this.tempZRot < 0 && this.movementPart == 1)
  19. {
  20. this.movementPart = 1;
  21. this.tempZRot += diff * (360 / (60 * 100));
  22. }
  23. else if (this.tempZRot < 0 && this.movementPart == 0)
  24. this.movementPart = 1;
  25. else
  26. {
  27. this.handMove++;
  28. this.movementPart = 0;
  29. if (this.handMove == 4)
  30. this.movementPart = 4;
  31. }
  32. }
  33. else if (this.movementPart != 4)
  34. this.tempXRot -= diff * (360 / (60 * 50));
  35. else
  36. {
  37. if (-this.armRotation + 10 > this.tempXRot && -this.armRotation - 10 < this.tempXRot)
  38. {
  39. this.handMove = 0;
  40. this.tempXRot = 999;
  41. this.tempZRot = 999;
  42. this.movementPart = 0;
  43. }
  44. else
  45. this.tempXRot += diff * (360 / (60 * 50));
  46. }
  47. }
  48. this.lastUpdate = currTime;
  49.  
  50.  
  51.  
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement