three实现三维沙漠悬浮飞船驾驶游戏代码

代码语言:html

所属分类:其他

代码由deepseek-4.1 ai生成,可能有错误,仅供参考:点击查看提示词

代码描述:三维沙漠悬浮飞船驾驶游戏

代码标签: three 三维 沙漠 悬浮 飞船 驾驶 游戏 代码

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<title>DESERT HOVER — 沙漠悬浮飞船</title>
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    width: 100%; height: 100%; overflow: hidden; background: #150a18;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #fff;
  }
  #app { position: fixed; inset: 0; }
  canvas { display: block; }

  /* ================= HUD 叠加层 ================= */
  #hud { position: fixed; inset: 0; pointer-events: none; user-select: none; z-index: 5; }

  #vignette {
    position: fixed; inset: 0; pointer-events: none; z-index: 4;
    background: radial-gradient(ellipse at 50% 50%,
                rgba(0,0,0,0) 42%,
                rgba(40,4,40,0.28) 78%,
                rgba(8,0,12,0.75) 100%);
  }

  /* ---- 准星 ---- */
  #crosshair {
    position: absolute; left: 50%; top: 50%;
    width: 150px; height: 150px;
    transform: translate(-50%, -50%);
    opacity: 0.85;
  }
  #crosshair .ring { position: absolute; border-radius: 50%; }
  #crosshair .outer {
    inset: 0;
    border: 1.5px solid rgba(255,255,255,0.55);
    box-shadow: 0 0 14px rgba(255,60,220,0.55), inset 0 0 18px rgba(255,60,220,0.22);
  }
  #crosshair .inner { inset: 52px; border: 1px solid rgba(255,255,255,0.32); }
  #crosshair .dot {
    position: absolute; left: 50%; top: 50%;
    width: 4px; height: 4px; margin: -2px 0 0 -2px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 0 8px #ff44ee, 0 0 16px #ff44ee;
  }
  #crosshair .tick { position: absolute; background: rgba(255,255,255,0.7); box-shadow: 0 0 6px rgba(255,80,230,0.9); }
  #crosshair .tick.t { left: 50%; top: -22px;    width: 1.5px; height: 20px; margin-left: -0.75px; }
  #crosshair .tick.b { left: 50%; bottom: -22px; width: 1.5px; height: 20px; margin-left: -0.75px; }
  #crosshair .tick.l { top: 50%; left: -22px;    height: 1.5px; width: 20px; margin-top: -0.75px; }
  #crosshair .tick.r { top: 50%; right: -22px;   height: 1.5px; width: 20px; margin-top: -0.75px; }

  /* ---- 速度仪表 ---- */
  #telemetry { position: absolute; right: 42px; bottom: 40px; text-align: right; font-variant-numeric: tabular-nums; }
  #speedText {
    font-size: 30px; font-weight: 700; letter-spacing: 2px;
    color: #ffe6fb; text-shadow: 0 0 12px rgba(255,60,220,0.9), 0 0 30px rgba(160,0,255,0.6);
  }
  #telemetry .bar {
    width: 220px; height: 6px; margin-top: 8px; margin-left: auto;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,120,240,0.35);
    border-radius: 3px; overflow: hidden;
  }
  #speedFill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, #6a00ff, #ff26d4, #ff8af5);
    box-shadow: 0 0 12px rgba(255,60,220,0.9);
    transition: width 0.08s linear;
  }

  /* ---- 操作提示 ---- */
  #help {
    position: absolute; left: 36px; bottom: 36px;
    font-size: 13px; line-height: 1.85; letter-spacing: 1px;
    color: rgba(255,220,250,0.72);
    text-shadow: 0 0 10px rgba(120,0,120,0.8);
  }
  #help b { color: #ff9df0; font-weight: 600; }

  #status {
    position: absolute; left: 36px; top: 30px;
    font-size: 13px; lette.........完整代码请登录后点击上方下载按钮下载查看

网友评论0