Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TagPro Mod: Ball Spin + Better P-ups
  3. // @namespace http://www.reddit.com/user/NewCompte
  4. // @description Rotating Balls, pixel perfect power-ups, power-up spawn tile, and new textures.
  5. // @include http://*.koalabeast.com*
  6. // @include http://*.jukejuice.com*
  7. // @include http://*.newcompte.fr*
  8. // @include http://justletme.be*
  9. // @license GPL
  10. // @author NewCompte, small additions by Cumflakes
  11. // @version 0.5
  12. // ==/UserScript==
  13. function myRotatingBallsScript() {
  14. tagpro.ready(function(){
  15. if(tagpro.events.drawPlayer)
  16. return;
  17. document.getElementById("tiles").src = "http://i.imgur.com/2ZIC8sa.png";
  18. document.getElementById("speedpad").src = "http://i.imgur.com/22eydBT.png";
  19. document.getElementById("speedpadred").src = "http://i.imgur.com/mdS1Ex7.png";
  20. document.getElementById("speedpadblue").src = "http://i.imgur.com/oWxNfsx.png";
  21. document.getElementById("portal").src = "http://i.imgur.com/BEr4T9e.png";
  22. tagpro.events.register({
  23. drawPlayer: function(player, context, drawPos, TILESIZE) {
  24. context.save();
  25. context.translate(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom));
  26. context.rotate(player.angle)
  27. context.translate(-drawPos.x - (TILESIZE / 2) * (1 / tagpro.zoom), -drawPos.y - (TILESIZE / 2) * (1 / tagpro.zoom));
  28. tagpro.tiles.drawWithZoom(context, player.team == 1 ? "redball" : "blueball", drawPos);
  29. if (player.bomb && Math.round(Math.random() * 4) == 1) {
  30. context.fillStyle = "rgba(255, 255, 0, 0.5)";
  31. context.beginPath();
  32. context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 19 * (1 / tagpro.zoom), 0, Math.PI*2, true);
  33. context.closePath();
  34. context.fill();
  35. };
  36. if (player.tagpro) {
  37. context.strokeStyle = "rgba(0, 255, 0, .8)";
  38. context.fillStyle = "rgba(0, 255, 0, .25)";
  39. context.lineWidth = 3 * (1 / tagpro.zoom);
  40. context.beginPath();
  41. context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 17 * (1 / tagpro.zoom), 0, Math.PI*2, true);
  42. context.closePath();
  43. if (!player.bomb)
  44. context.fill();
  45. context.stroke();
  46. }
  47. context.restore();
  48. }
  49. });
  50. });
  51. }
  52. var source = "("+ myRotatingBallsScript + ")()";
  53. var script = document.createElement('script');
  54. script.setAttribute("type", "application/javascript");
  55. script.textContent = source;
  56. document.body.appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement