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));
})();