three实现三维水管漫水逃生游戏代码

代码语言:html

所属分类:游戏

代码描述:three实现三维水管漫水逃生游戏代码

代码标签: three 三维 水管 漫水 逃生 游戏 代码

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

<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>水漫管道逃生 - Three.js</title>
  <style>
    html, body {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #000;
      font-family: Arial, "Microsoft YaHei", sans-serif;
    }

    canvas {
      display: block;
    }

    #hud {
      position: fixed;
      top: 14px;
      left: 14px;
      z-index: 10;
      pointer-events: none;
      color: #fff;
      user-select: none;
    }

    .hudCard {
      background: rgba(2, 18, 30, 0.42);
      border: 1px solid rgba(140, 220, 255, 0.18);
      border-radius: 14px;
      padding: 10px 14px;
      backdrop-filter: blur(4px);
      min-width: 240px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    }

    .hudTitle {
      font-weight: 900;
      color: #7fe7ff;
      margin-bottom: 6px;
      font-size: 15px;
    }

    .hudRow {
      font-size: 13px;
      margin: 3px 0;
      color: #dff6ff;
    }

    .barOuter {
      width: 100%;
      height: 14px;
      background: rgba(255, 255, 255, 0.14);
      border-radius: 7px;
      overflow: hidden;
      margin-top: 4px;
    }

    #airBar {
      height: 100%;
      width: 100%;
      border-radius: 7px;
      transition: width 0.12s linear;
      background: linear-gradient(90deg, #39ff88, #00cfff);
    }

    .hudTip {
      font-size: 11px;
      opacity: 0.78;
      margin-top: 6px;
      color: #bfe9ff;
    }

    #underwaterOverlay {
      position: fixed;
      inset: 0;
      z-index: 5;
      pointer-events: none;
      background: rgba(0, 110, 220, 0.42);
      opacity: 0;
      transition: opacity 0.15s linear;
    }

    #damageOverlay {
      position: fixed;
      inset: 0;
      z-index: 6;
      pointer-events: none;
      background: radial-gradient(circle, rgba(255, 0, 0, 0) 35%, rgba(255, 0, 0, 0.42) 100%);
      opacity: 0;
    }

    #overlay {
      position: fixed;
      inset: 0;
      z-index: 30;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(2, 10, 18, 0.72);
      backdrop-filter: blur(6px);
    }

    .card {
      width: min(92vw, 580px);
      background: linear-gradient(180deg, rgba(9, 28, 44, 0.96), rgba(4, 14, 24, 0.96));
      border: 1px solid rgba(120, 220, 255, 0.25);
      border-radius: 20px;
      padding: 28px 32px;
      color: #e8fbff;
      box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
      text-align: center;
    }

    .card h1 {
      margin: 0 0 10px;
      color: #7fe7ff;
    }

    .card p {
      line-height: 1.65;
      color: #c9e9f5;
    }

    .card ul {
      text-align: left;
      color: #a8d4e6;
      line-height: 1.75;
      padding-left: 20px;
    }

    #startBtn {
      margin-top: 18px;
      padding: 12px 34px;
      font-size: 18px;
      font-weight: bold;
      border: none;
      border-radius: 12px;
      cursor: pointer;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0