Created
February 7, 2016 18:06
-
-
Save arfie/7ae17007a02a382019db to your computer and use it in GitHub Desktop.
TagPro Animation FPS
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 Animation FPS | |
// @namespace http://www.arfie.nl/ | |
// @version 0.1 | |
// @description Allows to change FPS of boosts/portals | |
// @author Ruud | |
// @include http://tagpro-*.koalabeast.com:* | |
// @include http://*.newcompte.fr:* | |
// @include http://tangent.jukejuice.com:* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
var ANIMATION_FPS = 4, // Standard FPS for animations | |
// 4 by default | |
ANIMATION_FPS_RANDOM_FACTOR = 0.1; // A random value in range 0-x will be added to the FPS every time an animation is drawn | |
// 0 to disable | |
// 0.1 by default | |
// This is used to make animations look less synchronous. If you use a high standard FPS, it might be good to increase this value. | |
tagpro.ready(function() { | |
var da = tagpro.renderer.drawAnimation; | |
tagpro.renderer.drawAnimation = function(e, t) { | |
var r = da(e, t); | |
r.fps = ANIMATION_FPS + ANIMATION_FPS_RANDOM_FACTOR * Math.random(); | |
r.playSequence(); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment