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, maximum-scale=1.0, user-scalable=no">
<title>三维神庙逃亡</title>
<style>
  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #17100b;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    touch-action: none;
    overscroll-behavior: none;
  }

  #app {
    position: fixed;
    inset: 0;
  }

  canvas {
    display: block;
  }

  #hud {
    position: fixed;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 10px;
    z-index: 5;
    pointer-events: none;
  }

  .pill {
    background: rgba(25, 15, 8, 0.58);
    border: 1px solid rgba(255, 210, 130, 0.35);
    color: #ffe8c2;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 16px;
    backdrop-filter: blur(4px);
  }

  #menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, rgba(70, 42, 18, 0.35), rgba(0, 0, 0, 0.72));
    z-index: 10;
  }

  .panel {
    background: rgba(30, 20, 12, 0.9);
    border: 2px solid #b8864f;
    border-radius: 18px;
    padding: 32px 42px;
    text-align: center;
    color: #ffe8c2;
    max-width: min(90vw, 560px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  }

  .panel h1 {
    margin: 0 0 12px;
    color: #ffd27a;
    font-size: 36px;
    text-shadow: 0 2px 0 #5a3413, 0 0 18px rgba(255, 180, 80, 0.35);
  }

  #finalScore {
    min-height: 24px;
    margin: 6px 0 18px;
    color: #ffd9a8;
    font-size: 18px;
    line-height: 1.6;
  }

  #startBtn {
    background: linear-gradient(#ffbf69, #c77b31);
    border: none;
    color: #2b1608;
    font-size: 22px;
    font-weight: bold;
    padding: 12px 36px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 0 #7c4515;
  }

  #startBtn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
  }

  #startBtn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #7c4515;
  }

  .help {
    color: #d8b78f;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 18px;
  }

  .hidden {
    display: none !important;
  }
</style>
</head>
<body>

<div id="app"></div>

<div id="hud" class="hidden">
  <div class="pill" id="score">分数: 0</.........完整代码请登录后点击上方下载按钮下载查看

网友评论0