three实现三维3d滑翔伞游戏代码

代码语言:html

所属分类:游戏

代码描述:three实现三维3d滑翔伞游戏代码

代码标签: three 三维 3d 滑翔伞 游戏 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D 滑翔伞飞行游戏</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { overflow: hidden; background: #000; font-family: 'Segoe UI', Arial, sans-serif; }
        canvas { display: block; }

        #ui-overlay {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            pointer-events: none;
            z-index: 10;
        }

        #hud {
            position: absolute;
            top: 20px; left: 20px;
            display: flex;
            gap: 15px;
        }

        .hud-item {
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: 12px;
            padding: 10px 18px;
            color: #fff;
            min-width: 100px;
        }

        .hud-item .label {
            font-size: 10px;
            color: rgba(255,255,255,0.5);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .hud-item .value {
            font-size: 22px;
            font-weight: 700;
            margin-top: 2px;
        }

        #altitude .value { color: #74b9ff; }
        #speed .value { color: #55efc4; }
        #score .value { color: #ffeaa7; }
        #rings .value { color: #fd79a8; }

        #compass {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.15);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #compass-arrow {
            width: 4px;
            height: 35px;
            background: linear-gradient(to top, transparent 50%, #ff6b6b 50%);
            transform-origin: bottom center;
            position: absolute;
            bottom: 50%;
            border-radius: 2px;
        }

        #compass .n-label {
            position: absolute;
            top: 6px;
            font-size: 10px;
            font-weight: 700;
            color: #ff6b6b;
        }

        #wind-indicator {
            position: absolute;
            top: 110px;
            right: 20px;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: 12px;
            padding: 10px 15px;
            color: #fff;
            font-size: 12px;
            text-align: center;
        }

        #wind-indicator .wind-arrow {
            font-size: 20px;
            display: inline-block;
        }

        #crosshair {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 30px; height: 30px;
            opacity: 0.4;
        }

        #crosshair::before, #crosshair::after {
            content: '';
            position: absolute;
            background: #fff;
        }

        #crosshair::before {
            width: 2px; height: 100%;
            left: 50%; transform: translateX(-50%);
        }

        #crosshair::after {
            width: 100%; height: 2px;
            top: 50%; transform: translateY(-50%);
        }

        #message {
            position: absolute;
            top: 45%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 32px;
            font-weight: 700;
            color: #ffeaa7;
            text-shadow: 0 0 30px rgba(255,234,167,0.5);
            opacity: 0;
            transition: opacity 0.3s;
            text-align: center;
        }

        #message.show { opacity: 1; }

        #notification {
            position: absolute;
            top: 30%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 18px;
            color: #55efc4;
            text-shadow: 0 0 15px rgba(85,239,196,0.5);
            opacity: 0;
            transition: opacity 0.5s;
        }

        #notification.show { opacity: 1; }

        /* 起始界面 */
        #start-screen {
            position: absolute;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            pointer-events: all;
            z-index: 20;
        }

        #start-screen.hidden { display: none; }

        #start-screen h1 {
            font-size: 56px;
          .........完整代码请登录后点击上方下载按钮下载查看

网友评论0