Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name TagPro Spin Marbles
- // @namespace http://www.reddit.com/user/CumFlakes
- // @description Marble spin effect.
- // @include http://*.koalabeast.com:*
- // @include http://*.jukejuice.com:*
- // @include http://*.newcompte.fr:*
- // @include http://justletme.be:*
- // @license 2014
- // @author Cflakes.
- // @version 1
- // ==/UserScript==
- function MarblesScript() {
- tagpro.ready(function(){
- if(tagpro.events.drawPlayer)
- return;
- var spinBalls = new Image();
- spinBalls.src = "http://i.imgur.com/EFxpfsm.png";
- document.getElementById("tiles").src = "http://i.imgur.com/22NGRaG.png";
- document.getElementById("splats").src = "http://i.imgur.com/pJ3HlcS.png";
- document.getElementById("speedpad").src = "http://i.imgur.com/h873jWW.png";
- document.getElementById("speedpadred").src = "http://i.imgur.com/CABP3Ig.png";
- document.getElementById("speedpadblue").src = "http://i.imgur.com/EwDvvsm.png";
- document.getElementById("portal").src = "http://i.imgur.com/fxYJYFi.png";
- tagpro.events.register({
- drawPlayer: function(player, context, drawPos, TILESIZE) {
- var color = (player.team == 1) ? 0 : 1;
- var overColor = (player.team == 1) ? 2 : 3;
- context.drawImage(spinBalls, color * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- context.save();
- context.translate(drawPos.x + (TILESIZE / 2) * (1 / tagpro.zoom), drawPos.y + (TILESIZE / 2) * (1 / tagpro.zoom));
- context.rotate(player.angle);
- context.translate(-drawPos.x - (TILESIZE / 2) * (1 / tagpro.zoom), -drawPos.y - (TILESIZE / 2) * (1 / tagpro.zoom));
- context.drawImage(spinBalls, overColor * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- context.restore();
- if (player.bomb && Math.round(Math.random() * 4) == 1) {
- context.fillStyle = "rgba(255, 255, 0, .50)";
- context.beginPath();
- 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);
- context.closePath();
- context.fill();
- };
- if (player.tagpro) {
- context.fillStyle = "rgba(0, 255, 0, .17)";
- context.beginPath();
- 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);
- context.closePath();
- if (!player.bomb)
- context.fill();
- context.drawImage(spinBalls, 4 * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom)
- }
- }
- });
- });
- }
- var source = "("+ MarblesScript + ")()";
- var script = document.createElement('script');
- script.setAttribute("type", "application/javascript");
- script.textContent = source;
- document.body.appendChild(script);
Add Comment
Please, Sign In to add comment