GeometryDash.com Speedhack

Speedhack mod for the Geometry Dash Web version.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         GeometryDash.com Speedhack
// @namespace    YouTubeDrawaria
// @version      12.0.1
// @description  Speedhack mod for the Geometry Dash Web version.
// @author       YouTubeDrawaria
// @match        *://*.geometrydash.com/game/*
// @match        *://geometrydash.com/demo*
// @grant        none
// @run-at       document-start
// @icon https://geometrydash.com/favicon.ico
 // @license MIT
// ==/UserScript==

(function () {
    'use strict';

    console.log("[GD Speedhack] Iniciando módulo de tiempo estable...");

    // Estado global de la velocidad
    const State = {
        speedhack: 1.0
    };

    // ==========================================
    // 1. SPEEDHACK (Secuestro de RAF)
    // ==========================================
    // Esta es la joya de la corona que engaña al navegador entero
    const originalRAF = window.requestAnimationFrame;
    let lastTime = performance.now();

    window.requestAnimationFrame = function(callback) {
        return originalRAF(function(time) {
            if (State.speedhack !== 1.0) {
                const delta = time - lastTime;
                // Dilatación o contracción del tiempo matemático
                time = lastTime + (delta * State.speedhack);
            }
            lastTime = time;
            callback(time);
        });
    };

    // ==========================================
    // 2. SINCRONIZACIÓN DE AUDIO PITCH
    // ==========================================
    // Mantiene la música a la misma velocidad que el juego
    setInterval(() => {
        if (window.game && window.game.scene) {
            const activeScene = window.game.scene.scenes.find(s => s.sys.isActive());
            if (activeScene && activeScene.sound) {
                activeScene.sound.getAllPlaying().forEach(s => {
                    // Solo actualizamos si la velocidad es diferente para no saturar
                    if (s.rate !== State.speedhack) {
                        s.setRate(State.speedhack);
                    }
                });
            }
        }
    }, 100);

    // ==========================================
    // 3. INTERFAZ DE USUARIO (MINIMALISTA)
    // ==========================================
    function crearUI() {
        if (document.getElementById('mh-speed-ui')) return;

        const style = document.createElement('style');
        style.innerHTML = `
            #mh-speed-ui {
                position: fixed; top: 15px; left: 15px; width: 250px;
                background: #0b1a2a; border: 2px solid #1abc9c; border-radius: 8px;
                font-family: 'Arial', sans-serif; color: white; z-index: 9999999;
                user-select: none; box-shadow: 0 0 15px rgba(0,0,0,0.7);
            }
            .mh-header {
                background: #1abc9c; padding: 10px; font-weight: bold; font-size: 14px;
                display: flex; justify-content: space-between; cursor: move;
                border-radius: 6px 6px 0 0; text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
            }
            .mh-content { padding: 15px; }
            .mh-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
            .mh-slider { width: 100%; cursor: pointer; margin-top: 10px; }
        `;
        document.head.appendChild(style);

        const menu = document.createElement('div');
        menu.id = 'mh-speed-ui';
        menu.innerHTML = `
            <div class="mh-header" id="mh-drag">
                <span>⏱️ GD Speedhack</span>
                <span id="mh-close" style="cursor:pointer">✖</span>
            </div>
            <div class="mh-content">
                <div class="mh-row">
                    <span>Speed:</span>
                    <span id="val-speed" style="color:#00ff00; font-weight:bold;">1.0x</span>
                </div>
                <input type="range" class="mh-slider" id="ui-speed" min="0.1" max="3" step="0.1" value="1">
            </div>
        `;
        document.body.appendChild(menu);

        // Eventos del Slider
        document.getElementById('ui-speed').oninput = e => {
            State.speedhack = parseFloat(e.target.value);
            document.getElementById('val-speed').innerText = State.speedhack.toFixed(1) + 'x';
        };

        // Lógica para arrastrar el menú
        const header = document.getElementById('mh-drag');
        let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
        header.onmousedown = e => {
            if(e.target.id === 'mh-close') return;
            e.preventDefault();
            pos3 = e.clientX; pos4 = e.clientY;
            document.onmouseup = () => { document.onmouseup = null; document.onmousemove = null; };
            document.onmousemove = e => {
                e.preventDefault();
                pos1 = pos3 - e.clientX; pos2 = pos4 - e.clientY;
                pos3 = e.clientX; pos4 = e.clientY;
                menu.style.top = Math.max(0, menu.offsetTop - pos2) + "px";
                menu.style.left = Math.max(0, menu.offsetLeft - pos1) + "px";
            };
        };

        document.getElementById('mh-close').onclick = () => menu.style.display = 'none';
    }

    // Iniciar UI
    window.addEventListener('DOMContentLoaded', () => setTimeout(crearUI, 1000));
})();