briochemc

light texture pack test

Jul 18th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          My_Texture pack and spin
  3. // @namespace     http://www.reddit.com/user/NewCompte
  4. // @description   Rotating Transparent gridded brioche texture pack
  5. // @include       http://*.koalabeast.com:*
  6. // @license       GPL
  7. // @author        NewCompte, modified by brioche
  8. // @version       1
  9. // ==/UserScript==
  10.  
  11. function myRotatingBallsScript() {
  12.     tagpro.ready(function(){
  13.         //This is important.
  14.         if(tagpro.events.drawPlayer)
  15.             return;
  16.         // Dark texture pack:
  17.         //document.getElementById("tiles").src = "http://i.imgur.com/q2TFiHE.png";
  18.         //document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  19.         //document.getElementById("speedpad").src = "http://i.imgur.com/UFbQ3JQ.png";
  20.         //document.getElementById("speedpadred").src = "http://i.imgur.com/XOtl1UT.png";
  21.         //document.getElementById("speedpadblue").src = "http://i.imgur.com/uQSjW46.png";
  22.         //document.getElementById("portal").src = "http://i.imgur.com/9AjSUYN.png";
  23.        
  24.         // Ligh texture pack:
  25.         document.getElementById("tiles").src = "http://i.imgur.com/IwuRMnQ.png";
  26.         document.getElementById("splats").src = "http://i.imgur.com/8g6gEF3.png";
  27.         document.getElementById("speedpad").src = "http://i.imgur.com/YfJuAqP.png";
  28.         document.getElementById("speedpadred").src = "http://i.imgur.com/8FNmZM0.png";
  29.         document.getElementById("speedpadblue").src = "http://i.imgur.com/IbYACWp.png";
  30.         document.getElementById("portal").src = "http://i.imgur.com/cv8PUOb.png";
  31.  
  32.         tagpro.events.register({
  33.             drawPlayer: function(player, context, drawPos, TILESIZE) {
  34.                 context.save();
  35.                 context.translate(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom));
  36.                 context.rotate(player.angle)
  37.                 context.translate(-drawPos.x - (TILESIZE / 2) * (1 / tagpro.zoom), -drawPos.y - (TILESIZE / 2) * (1 / tagpro.zoom));
  38.                
  39.                 tagpro.tiles.drawWithZoom(context, player.team == 1 ? "redball" : "blueball", drawPos);
  40.  
  41.                 if (player.bomb && Math.round(Math.random() * 4) == 1) {
  42.                     context.fillStyle = "rgba(255, 255, 0, .60)";
  43.                     context.beginPath();
  44.                     context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 20  * (1 / tagpro.zoom), 0, Math.PI*2, true);
  45.                     context.closePath();
  46.                     context.fill();
  47.                 };
  48.  
  49.                 if (player.tagpro) {
  50.                     context.strokeStyle = "#00FF00";
  51.                     context.fillStyle = "rgba(0, 255, 0, .30)";
  52.                     context.lineWidth = 2 * (1 / tagpro.zoom);
  53.                     context.beginPath();
  54.                     context.arc(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom), 18  * (1 / tagpro.zoom), 0, Math.PI*2, true);
  55.                     context.closePath();
  56.                     if (!player.bomb)
  57.                         context.fill();
  58.                     context.stroke();
  59.                 }
  60.  
  61.                 context.restore();
  62.             }
  63.         });
  64.     });
  65. }
  66.  
  67. var source = "("+ myRotatingBallsScript + ")()";
  68. var script = document.createElement('script');
  69. script.setAttribute("type", "application/javascript");
  70. script.textContent = source;
  71.  
  72. document.body.appendChild(script);
Add Comment
Please, Sign In to add comment