Aladdin

its good

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.sleazyfork.org/scripts/577172/1819104/Aladdin.js

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

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

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

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

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

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

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

Advertisement:

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

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

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

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

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

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

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

Advertisement:

let player = {
    x: 100,
    y: 100,
    vx: 0, // Velocity X
    vy: 0, // Velocity Y
    speed: 5,
    friction: 0.9 // This creates the "drifting" feel of flight
};

function updatePosition() {
    // Apply friction to slow down gradually
    player.vx *= player.friction;
    player.vy *= player.friction;

    // Update coordinates based on velocity
    player.x += player.vx;
    player.y += player.vy;
}

window.addEventListener('keydown', (e) => {
    if (e.key === 'w') player.vy -= player.speed;
    if (e.key === 's') player.vy += player.speed;
    if (e.key === 'a') player.vx -= player.speed;
    if (e.key === 'd') player.vx += player.speed;
});