Created
July 9, 2016 20:50
-
-
Save jbaaybaay/55959522051fd2c0580ef55897ca7316 to your computer and use it in GitHub Desktop.
Marble Spin Comp Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name TagPro Marble Spin | |
// @version 0.1 | |
// @description Adds a marble overlay texture to the balls to show spin | |
// @include http://tagpro-*.koalabeast.com:* | |
// @include http://tangent.jukejuice.com:* | |
// @include http://*.newcompte.fr:* | |
// @author Some Ball -1 (Cflakes for the marble texture) | |
// ==/UserScript== | |
if ((window.sessionStorage.toggles && JSON.parse(window.sessionStorage.toggles).marble)){ | |
tagpro.ready(function() { | |
tr = tagpro.renderer; | |
tr.createSpin = function(player) { | |
var marble = new PIXI.Sprite(PIXI.Texture.fromImage("http://i.imgur.com/yT42PHy.png")); | |
player.sprites.marble = marble; | |
player.sprites.ball.addChild(player.sprites.marble); | |
player.sprites.marble.anchor.x = .5; | |
player.sprites.marble.anchor.y = .5; | |
player.sprites.marble.x = 20; | |
player.sprites.marble.y = 20; | |
} | |
var old2 = tr.updatePlayerSpritePosition; | |
tr.updatePlayerSpritePosition = function (player) { | |
if(!player.sprites.marble) | |
{ | |
tr.createSpin(player); | |
} | |
player.sprites.marble.rotation = player.angle; | |
old2(player); | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment