Advertisement
Arbybear

TagPro Old Death

Jul 15th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TagPro Old Death
  3. // @version 0.2
  4. // @grant none
  5. // @include http://tagpro-*.koalabeast.com:*
  6. // @include http://tangent.jukejuice.com:*
  7. // @include http://*.newcompte.fr:*
  8. // @license 2015
  9. // ==/UserScript==
  10.  
  11. tagpro.ready(function () {
  12. var tr = tagpro.renderer;
  13.  
  14. tr.animateBallPop = function (texture, started) {
  15. var now = performance.now(),
  16. duration = now - started;
  17. texture.scale.x += duration / 50;
  18. texture.scale.y += duration / 50;
  19. texture.alpha -= texture.alpha * duration / 60;
  20. if (texture.scale.x > 2.7) {
  21. tr.layers.foreground.removeChild(texture);
  22. } else {
  23. requestAnimationFrame(function () {
  24. tr.animateBallPop(texture, now);
  25. });
  26. }
  27. };
  28.  
  29. tr.drawBallPop = function (x, y, team) {
  30. var start = performance.now(),
  31. texture = team === 1 ? "redball" : "blueball",
  32. ballPop = tagpro.tiles.draw(tr.layers.foreground, texture, {
  33. x: x,
  34. y: y
  35. });
  36. ballPop.anchor.x = 0.5;
  37. ballPop.anchor.y = 0.5;
  38. tr.animateBallPop(ballPop, start);
  39. };
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement