TT FPS Uncapper

Uncaps the default 60 FPS limit for smoother gameplay

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         TT FPS Uncapper
// @namespace    http://tampermonkey.net/
// @version      2.0.0
// @description  Uncaps the default 60 FPS limit for smoother gameplay
// @author       Aurelion-X9
// @match        https://tanktrouble.com/*
// @match        https://*.tanktrouble.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Safe FPS Uncapper - only modifies time settings, no prototype overrides

    // Patch Phaser time settings when game is ready
    const patchPhaserTime = () => {
        const check = setInterval(() => {
            const game = (typeof GameManager !== 'undefined' && GameManager.getGame) ? GameManager.getGame() : null;
            if (game && game.time) {
                clearInterval(check);

                // Enable advanced timing for accurate FPS display
                game.time.advancedTiming = true;

                // Set desired FPS higher (this affects physics interpolation)
                game.time.desiredFps = 120;

                // Don't modify slowMotion - keep it at 1.0
                if (game.time.slowMotion !== undefined) {
                    game.time.slowMotion = 1.0;
                }
            }
        }, 200);
        setTimeout(() => clearInterval(check), 5000);
    };

    // CSS for smoother rendering - minimal
    const injectCSS = () => {
        const style = document.createElement('style');
        style.id = 'tt-fps-uncapper-css';
        style.textContent = `
            /* Force GPU acceleration on canvas only */
            #game canvas, #gameCanvas {
                image-rendering: crisp-edges !important;
            }
        `;
        document.head.appendChild(style);
    };

    // Initialize
    injectCSS();

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', patchPhaserTime);
    } else {
        patchPhaserTime();
    }

    console.log('%c[TT FPS Uncapper] 60 FPS limit removed!', 'color: #00ff88; font-weight: bold;');
})();