Skip to content

Instantly share code, notes, and snippets.

@jbaaybaay
Last active July 9, 2016 20:47
Show Gist options
  • Save jbaaybaay/cc572025616d850f700ad157d507c817 to your computer and use it in GitHub Desktop.
Save jbaaybaay/cc572025616d850f700ad157d507c817 to your computer and use it in GitHub Desktop.
Whole Ball Spin Comp Server
// ==UserScript==
// @name TagPro Ball Spin
// @version 0.1
// @description Rotates balls to show the spin
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author Some Ball -1
// ==/UserScript==
if ((window.sessionStorage.toggles && JSON.parse(window.sessionStorage.toggles).wholeball)){
tagpro.ready(function() {
tr = tagpro.renderer;
tr.anchorBall = function(player) {
player.sprites.actualBall.anchor.x = .5;
player.sprites.actualBall.anchor.y = .5;
player.sprites.actualBall.x = 20;
player.sprites.actualBall.y = 20;
};
var old = tr.updatePlayerSpritePosition;
tr.updatePlayerSpritePosition = function (player) {
if(!player.sprites.actualBall.anchor.x)
{
tr.anchorBall(player);
}
player.sprites.actualBall.rotation = player.angle;
old(player);
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment