three实现三维末日暴雪求生游戏代码

代码语言:html

所属分类:其他

代码由gemini-4 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.0" />
<title>冰原余生:雪地末日求生 3D</title>
<style>
  * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
  body {
    overflow: hidden;
    background: #0d1520;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    color: #eaf2f8;
  }
  #game-container { position: fixed; inset: 0; }

  /* 屏幕边缘特效:冻伤 & 受伤 */
  #frost-overlay, #damage-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 5; transition: opacity 0.25s;
  }
  #frost-overlay {
    opacity: 0;
    background: radial-gradient(circle at center, transparent 48%, rgba(135, 210, 255, 0.45) 85%, rgba(210, 240, 255, 0.85) 100%);
    box-shadow: inset 0 0 90px rgba(170, 230, 255, 0.75);
  }
  #damage-overlay {
    opacity: 0;
    background: radial-gradient(circle at center, transparent 45%, rgba(200, 20, 20, 0.65) 100%);
  }

  /* HUD 界面 */
  #hud {
    position: fixed; inset: 0; pointer-events: none; z-index: 10; display: none;
  }

  /* 左上角任务清单 */
  #objectives {
    position: absolute; top: 18px; left: 18px;
    background: rgba(10, 18, 28, 0.72);
    border: 1px solid rgba(150, 200, 255, 0.28);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 245px;
    backdrop-filter: blur(6px);
  }
  #objectives h3 {
    font-size: 14px; letter-spacing: 1px; color: #7ec8ff; margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.12); padding-bottom: 5px;
  }
  .obj-item {
    font-size: 13px; margin: 6px 0; display: flex; align-items: center; gap: 8px;
    color: #d5e2ee; transition: color 0.2s;
  }
  .obj-item.done { color: #6ee7b7; text-decoration: line-through; opacity: 0.85; }
  .obj-box {
    width: 14px; height: 14px; border-radius: 3px;
    border: 1.5px solid #7ec8ff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
  }
  .obj-item.done .obj-box { background: #10b981; border-color: #10b981; color: #052e16; font-weight: bold; }

  /* 顶部指北针/逃生车方向 */
  #compass {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    background: rgba(10, 18, 28, 0.72);
    border: 1px solid rgba(150, 200, 255, 0.25);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px;
    display: flex; align-items: center; gap: 14px;
    backdrop-filter: blur(6px);
  }
  .compass-dir { color: #93c5fd; font-weight: bold; }
  .compass-car { color: #fbbf24; }

  /* 右上角统计 */
  #stats-top {
    position: absolute; top: 18px; right: 18px;
    background: rgba(10, 18, 28, 0.72);
    border: 1px solid rgba(150, 200, 255, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px; text-align: right;
    backdrop-filter: blur(6px);
    line-height: 1.6;
  }

  /* 左下角生存状态条 */
  #vitals {
    position: absolute; bottom: 20px; left: 20px;
    width: 270px;
    background: rgba(10, 18, 28, 0.75);
    border: 1px solid rgba(150, 200, 255, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    backdrop-filter: blur(6px);
  }
  .bar-row { margin-bottom: 8px; }
  .bar-row:last-child { margin-bottom: 0; }
  .bar-label {
    display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px;
    color: #cbd5e1;
  }
  .bar-track {
    height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden;
  }
  .bar-fill { height: 100%; width: 100%; border-radius: 4px; transition: width 0.15s; }
  #bar-hp { background: linear-gradient(90deg, #dc2626, #f87171); }
  #bar-temp { background: linear-gradient(90deg, #0284c7, #38bdf8, #fb923c); }
  #bar-hunger { background: linear-gradient(90deg, #d97706, #fbbf24); }
  #bar-stamina { background: linear-gradient(90deg, #059669, #34d399); }
  #coat-badge {
    margin-top: 8px; font-size: 12px; padding: 4px 8px; border-radius: 5px;
    background: rgba(255,255,255,0.06); color: #94a3b8; display: inline-block;
  }
  #coat-badge.equipped { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.4); }

  /* 右下角武器栏 */
  #weapon-hud {
    position: absolute; bottom: 20px; right: 20px;
    background: rgba(10, 18, 28, 0.75);
    border: 1px solid rgba(150, 200, 255, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: right; min-width: 195px;
    backdrop-filter: blur(6px);
  }
  #weapon-name { font-size: 15px; font-weight: bold; color: #f8fafc; }
  #weapon-ammo { font-size: 24px; font-weight: bold; color: #fbbf24; margin: 2px 0; }
  #weapon-hint { font-size: 11px; color: #94a3b8; }

  /* 中心准星与交互提示 */
  #crosshair {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 18px; height: 18px;
  }
  #crosshair::before, #crosshair::after {
    content: ""; position: absolute; background: rgba(255,255,255,0.85);
    box-shadow: 0 0 3px rgba(0,0,0,0.8);
  }
  #crosshair::before { left: 8px; top: 2px; width: 2px; height: 14px; }
  #crosshair::after { top: 8px; left: 2px; width: 14px; height: 2px; }
  #hitmarker {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(45deg);
    width: 18px; height: 18px; opacity: 0; transition: opacity 0.1s;
  }
  #hitmarker::before, #hitmarker::after {
    content: ""; position: absolute; background: #ef4444;
  }
  #hitmarker::before { left: 8px; top: 0; width: 2px; height: 18px; }
  #hitmarker::after { top: 8px; left: 0; width: 18px; height: 2px; }

  #interact-prompt {
    position: absolute; top: 58%; left: 50%; transform: translateX(-50%);
    background: rgba(8, 15, 25, 0.85);
    border: 1px solid rgba(251, 191, 36, 0.6);
    color: #fde68a;
    padding: 8px 16px; border-radius: 8px;
    font-size: 14px; font-weight: bold;
    display: none;
  }
  #ignition-bar-wrap {
    position: absolute; top: 64%; left: 50%; transform: translateX(-50%);
    width: 220px; background: rgba(0,0,0,0.75); border: 1px solid #fbbf24;
    border-radius: 6px; padding: 4px; display: none;
  }
  #ignition-bar { height: 10px; width: 0%; background: #fbbf24; border-radius: 3px; }

  #toast-msg {
    position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.88);
    border-left: 4px solid #38bdf8;
    padding: 9px 18px; border-radius: 6px;
    font-size: 14px; opacity: 0; transition: opacity 0.25s;
  }

  /* 全屏弹窗(开始/暂停/失败/胜利) */
  .overlay-screen {
    position: fixed; inset: 0; z-index: 30;
    background: radial-gradient(circle at center, rgba(16, 30, 48, 0.88), rgba(6, 11, 18, 0.96));
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
  }
  .panel {
    max-width: 560px; width: 100%;
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0