Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name TagPro Pro
- // @namespace http://www.reddit.com/user/CumFlakes
- // @description Rotating Balls, pixel perfect power-ups.
- // @include http://*.koalabeast.com*
- // @include http://*.jukejuice.com*
- // @include http://*.newcompte.fr*
- // @include http://justletme.be*
- // @license GPL
- // @author NewCompte, Ly, Cumflakes.
- // @version 1
- // ==/UserScript==
- function myRotatingBallsScript() {
- tagpro.ready(function(){
- if(tagpro.events.drawPlayer)
- return;
- var image = new Image();
- image.src = "http://i.imgur.com/K9SbmSz.png";
- document.getElementById("tiles").src = "http://i.imgur.com/HiZYdww.png";
- document.getElementById("splats").src = "http://lejdesigns.com/splats.png";
- document.getElementById("speedpad").src = "http://i.imgur.com/HTCSHhe.png";
- document.getElementById("speedpadred").src = "http://i.imgur.com/UarfAlB.png";
- document.getElementById("speedpadblue").src = "http://i.imgur.com/R7Qvfgg.png";
- document.getElementById("portal").src = "http://i.imgur.com/BEr4T9e.png";
- tagpro.events.register({
- drawPlayer: function(player, context, drawPos, TILESIZE) {
- 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));
- tagpro.tiles.drawWithZoom(context, player.team == 1 ? "redball" : "blueball", drawPos);
- context.restore();
- ///ADDED IF THEN STATEMENT HERE
- if (tagpro.switchedColors) {
- if (player.team == 2)
- context.drawImage(image, 0 * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- if (player.team == 1)
- context.drawImage(image, 1 * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- } else {
- if (player.team == 1)
- context.drawImage(image, 0 * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- if (player.team == 2)
- context.drawImage(image, 1 * 40, 0, 40, 40, drawPos.x, drawPos.y, 40 / tagpro.zoom, 40 / tagpro.zoom);
- }
- 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.strokeStyle = "rgba(0, 255, 0, .80)";
- context.fillStyle = "rgba(0, 255, 0, .25)";
- context.lineWidth = 3 * (1 / tagpro.zoom);
- 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.stroke();
- }
- }
- });
- });
- }
- var source = "("+ myRotatingBallsScript + ")()";
- 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