three实现一个三维足球射门游戏代码

代码语言:html

所属分类:游戏

代码描述:three实现一个三维足球射门游戏代码

代码标签: 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>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { overflow: hidden; background: #000; font-family: 'Segoe UI', Arial, sans-serif; cursor: none; }
        canvas { display: block; }

        #crosshair {
            position: fixed;
            pointer-events: none;
            z-index: 1000;
            transform: translate(-50%, -50%);
        }
        #crosshair .ring {
            width: 40px; height: 40px;
            border: 2px solid rgba(255,255,255,0.8);
            border-radius: 50%;
            position: relative;
        }
        #crosshair .dot {
            width: 4px; height: 4px;
            background: #ff3333;
            border-radius: 50%;
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 6px #ff3333;
        }
        #crosshair .line {
            position: absolute; background: rgba(255,255,255,0.5);
        }
        #crosshair .line.h { width: 8px; height: 1px; top: 50%; transform: translateY(-50%); }
        #crosshair .line.v { height: 8px; width: 1px; left: 50%; transform: translateX(-50%); }
        #crosshair .line.l { left: -4px; }
        #crosshair .line.r { right: -4px; }
        #crosshair .line.t { top: -4px; }
        #crosshair .line.b { bottom: -4px; }

        #hud {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none; z-index: 10;
        }

        #scoreboard {
            position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
            background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.65));
            color: #fff; padding: 10px 30px; border-radius: 8px;
            display: flex; gap: 24px; font-size: 14px;
            border: 1px solid rgba(255,255,255,0.15);
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        }
        .stat { text-align: center; }
        .stat-value {
            font-size: 28px; font-weight: 700;
            background: linear-gradient(135deg, #4fc3f7, #00e5ff);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            line-height: 1.2;
        }
        .stat-label { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1px; }
        .stat-divider { width: 1px; background: rgba(255,255,255,0.15); margin: 0 4px; }

        #powerContainer {
            position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
            width: 280px; opacity: 0; transition: opacity 0.3s;
        }
        #powerContainer.active { opacity: 1; }
        #powerLabel {
            text-align: center; color: rgba(255,255,255,0.7); font-size: 12px;
            margin-bottom: 6px; letter-spacing: 2px; text-transform: uppercase;
        }
        #powerBarOuter {
            width: 100%; height: 14px;
            background: rgba(0,0,0,0.6);
            border-radius: 7px; overflow: hidden;
            border: 1px solid rgba(255,255,255,0.2);
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
        }
        #powerBarInner {
            width: 0%; height: 100%;
            border-radius: 7px;
            background: linear-gradient(90deg, #00e676, #ffeb3b, #ff5722, #d50000);
            box-shadow: 0 0 10px rgba(255,87,34,0.5);
            transition: width 0.05s linear;
        }
        #powerPercent {
            text-align: center; color: #fff; font-size: 20px; font-weight: 700;
            margin-top: 6px; text-shadow: 0 0 10px rgba(0,0,0,0.8);
        }

        #messageOverlay {
            position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            text-align: center; pointer-events: none;
            opacity: 0; transition: opacity 0.4s, transform 0.4s;
        }
        #messageOverlay.show { opacity: 1; }
        #messageOverlay .main-text {
            font-size: 72px; font-weight: 900;
            text-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 0 60px rgba(0,0,0,0.4);
            letter-spacing: 4px;
        }
        #messageOverlay .sub-text {
            font-size: 20px; color: rgba(255,255,255,0.8);
            margin-top: 8px; text-shadow: 0 2px 10px rgba(0,0,0,0.8);
        }
        .color-goal { color: #00e676; }
        .color-save { color: #ff9100; }
        .color-miss { color: #ff5252; }
        .color-post { color: #ffd600; }

        #instructions {
            position: absolute; bottom: 100px; left: 50%; transform: translateX(-50%);
            color: rgba(255,255,255,0.5); font-size: 13px; text-align: center;
            transition: opacity 0.5s;
        }

        #speedDisplay {
            position: absolute; top: 80px; right: 30px;
            color: rgba(255,255,255,0.7); font-size: 13px; text-align: right;
            opacity: 0; transition: opacity 0.3s;
        }
        #speedDisplay.show { opacity: 1; }
        #speedValue { font-size: 36px; font-weight: 700; color: #fff; line-height: 1; }
        #speedUnit { font-size: 14px; color: rgba(255,255,255,0.5); }

        #dirIndicator {
            position: absolute; top: 80px; left: 30px;
            width: 120px; height: 80px;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 6px;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(5px);
        }
        #dirDot {
            width: 8px; height: 8px;
            background: #ff3333;
            border-radius: 50%;
            position: absolute;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 8px #ff3333;
            transition: left 0.1s, top 0.1s;
        }
        #dirGoalOutline {
            position: absolute; top: 10%; left: 15%; width: 70%; height: 70%;
            border: 1px solid rgba(255,255,255,0.3);
            border-bottom: none;
        }

        #streak {
            posi.........完整代码请登录后点击上方下载按钮下载查看

网友评论0