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>3D消防车救火游戏</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            overflow: hidden;
            font-family: 'Arial', sans-serif;
            background: #1a1a2e;
        }
        
        #gameCanvas {
            display: block;
        }
        
        #ui {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            padding: 20px;
            pointer-events: none;
        }
        
        #stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }
        
        .stat-box {
            background: rgba(0, 0, 0, 0.7);
            padding: 15px 25px;
            border-radius: 10px;
            color: white;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 2px solid #ff6b35;
        }
        
        .stat-box i {
            font-size: 24px;
        }
        
        .stat-value {
            font-size: 24px;
            font-weight: bold;
            color: #ffd700;
        }
        
        #waterBar {
            width: 200px;
            height: 20px;
            background: #333;
            border-radius: 10px;
            overflow: hidden;
        }
        
        #waterLevel {
            height: 100%;
            background: linear-gradient(90deg, #00bcd4, #2196f3);
            transition: width 0.3s;
            width: 100%;
        }
        
        #controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            padding: 15px 30px;
            border-radius: 15px;
            color: white;
            text-align: center;
            border: 2px solid #ff6b35;
        }
        
        #controls h3 {
            color: #ffd700;
            margin-bottom: 10px;
        }
        
        #controls p {
            margin: 5px 0;
            font-size: 14px;
        }
        
        kbd {
            background: #ff6b35;
            padding: 3px 8px;
            border-radius: 5px;
            font-weight: bold;
        }
        
        #message {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.9);
            padding: 40px 60px;
            border-radius: 20px;
            color: white;
            text-align: center;
            display: none;
            border: 3px solid #ffd700;
        }
        
        #message h2 {
            font-size: 36px;
            margin-bottom: 20px;
            color: #ffd700;
        }
        
        #message p {
            font-size: 20px;
            margin: 10px 0;
        }
        
        #restartBtn {
            margin-top: 20px;
            padding: 15px 40px;
            font-size: 18px;
            background: linear-gradient(135deg, #ff6b35, #f7931e);
            border: none;
            border-radius: 10px;
            color: white;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            pointer-events: auto;
        }
        
        #restartBtn:hover {
            transform: scale(1.1);
            box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
        }
        
        #minimap {
            position: absolute;
            bottom: 100px;
            right: 20px;
            width: 180px;
            height: 180px;
            backgr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0