Skip to content

Instantly share code, notes, and snippets.

@jbaaybaay
Created July 3, 2016 18:04
Show Gist options
  • Save jbaaybaay/51551b26ec4913f7958c734ccbdcc23c to your computer and use it in GitHub Desktop.
Save jbaaybaay/51551b26ec4913f7958c734ccbdcc23c to your computer and use it in GitHub Desktop.
// ==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)) return;
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