Greasy Fork

Greasy Fork is available in English.

BloxD For Low-End PC's

Anima o céu, aumenta o FPS e otimiza o desempenho no BloxD.io

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         BloxD For Low-End PC's
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Anima o céu, aumenta o FPS e otimiza o desempenho no BloxD.io
// @author       Whoami
// @match        *://bloxd.io/*
// @grant        none
// @license      Zlib
// ==/UserScript==

(function() {
    'use strict';

    let targetFPS = 60;
    let lastTime = performance.now();

    function darkenSky() {
        const sky = document.querySelector('canvas');
        if (sky) {
            let ctx = sky.getContext('2d');
            ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
            ctx.fillRect(0, 0, sky.width, sky.height);
        }
    }

    function optimizeFPS() {
        removeUnnecessaryScripts();
        removeUnnecessaryDOMElements();
        disableAnimations();
        reduceGraphicsQuality();
    }

    function removeUnnecessaryScripts() {
        const unnecessaryScripts = ["unnecessary-script.js", "another-unnecessary-script.js"];
        unnecessaryScripts.forEach(scriptName => {
            const script = document.querySelector(`script[src*="${scriptName}"]`);
            if (script) {
                script.parentNode.removeChild(script);
            }
        });
    }

    function removeUnnecessaryDOMElements() {
        const elementsToRemove = document.querySelectorAll('.unnecessary-class, .another-unnecessary-class');
        elementsToRemove.forEach(element => {
            element.parentNode.removeChild(element);
        });
    }

    function disableAnimations() {
        const animatedElements = document.querySelectorAll('*');
        animatedElements.forEach(element => {
            element.style.animation = 'none';
            element.style.transition = 'none';
        });
    }

    function reduceGraphicsQuality() {
        const canvas = document.querySelector('canvas');
        if (canvas) {
            canvas.width = window.innerWidth * 0.5;
            canvas.height = window.innerHeight * 0.5;
        }
    }

    function gameLoop() {
        const now = performance.now();
        const delta = now - lastTime;

        if (delta > (1000 / targetFPS)) {
            lastTime = now - (delta % (1000 / targetFPS));
            darkenSky();
        }

        requestAnimationFrame(gameLoop);
    }

    requestAnimationFrame(gameLoop);
    optimizeFPS();
})();