three实现3d拖拽三维疯狂的小鸟游戏代码

代码语言:html

所属分类:游戏

代码描述:three实现3d拖拽三维疯狂的小鸟游戏代码

代码标签: three 3d 拖拽 三维 疯狂 小鸟 游戏 代码

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>🐦 3D 疯狂的小鸟</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            touch-action: none;
            user-select: none;
        }

        body {
            overflow: hidden;
            background: #87CEEB;
            font-family: 'Comic Sans MS', 'Arial', sans-serif;
        }

        #gameCanvas {
            width: 100vw;
            height: 100vh;
            display: block;
        }

        /* UI层 */
        .ui-layer {
            position: fixed;
            z-index: 100;
            pointer-events: none;
        }

        /* 分数面板 */
        .score-panel {
            top: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 15px 25px;
            border: 3px solid #ffd700;
        }

        .score-label {
            font-size: 14px;
            color: #ffd700;
        }

        .score-value {
            font-size: 42px;
            font-weight: bold;
            color: #fff;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }

        /* 关卡信息 */
        .level-panel {
            top: 20px;
            right: 20px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 15px 25px;
            border: 3px solid #ff6b6b;
            text-align: center;
        }

        .level-title {
            font-size: 18px;
            color: #ff6b6b;
        }

        .level-value {
            font-size: 36px;
            font-weight: bold;
            color: #fff;
        }

        /* 小鸟数量 */
        .birds-panel {
            bottom: 20px;
            left: 20px;
            display: flex;
            gap: 10px;
        }

        .bird-icon {
            width: 50px;
            height: 50px;
            background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
            border-radius: 50%;
            border: 3px solid #fff;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            transition: all 0.3s;
        }

        .bird-icon.used {
            opacity: 0.3;
            transform: scale(0.8);
        }

        /* 控制按钮 */
        .control-panel {
            bottom: 20px;
            right: 20px;
            display: flex;
            gap: 10px;
            pointer-events: auto;
        }

        .ctrl-btn {
            padding: 15px 25px;
            font-size: 16px;
            font-weight: bold;
            color: #fff;
            border: none;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }

        .btn-reset {
            background: linear-gradient(135deg, #f39c12, #e67e22);
        }

        .btn-next {
            background: linear-gradient(135deg, #2ecc71, #27ae60);
        }

        .btn-camera {
            background: linear-gradient(135deg, #3498db, #2980b9);
        }

        .ctrl-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.4);
        }

        /* 瞄准线提示 */
        .aim-guide {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.7);
            padding: 10px 20px;
            border-radius: 20px;
            color: #fff;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .aim-guide.visible {
            opacity: 1;
        }

        /* 开始界面 */
        .start-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 100%);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            transition: opacity 0.5s, visibility 0.5s;
        }

        .start-screen.hidden {
            opacity: 0;
            visibility: hidden;
        }

        .game-logo {
            font-size: 100px;
            margin-bottom: 20px;
            animation: bounce 1s infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0) rotate(-5deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
        }

        .game-title {
            font-size: 56px;
            color: #c0392b;
            text-shadow: 4px 4px 0 #fff, 6px 6px 0 rgba(0,0,0,0.2);
            margin-bottom: 10px;
        }

        .game-subtitle {
            font-size: 24px;
            color: #666;
            margin-bottom: 50px;
        }

        .start-btn {
            padding: 25px 80px;
            font-size: 28px;
            font-weight: bold;
            color: #fff;
            background: linear-gradient(135deg, #e74c3c, #c0392b);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            pointer-events: auto;
            transition: all 0.3s;
            box-shadow: 0 10px 30px rgba(231, 76, 60, 0.4);
        }

        .start-btn:hover {
            transform: translateY(-5px) scale(1.05);
            box-shadow: 0 15px 40px rgba(231, 76, 60, 0.6);
        }

        .instructions {
            margin-top: 40px;
            text-align: center;
            color: #555;
            line-height: 2;
        }

        .instructions span {
            display: inline-block;
            margin: 5px;
            padding: 8px 16px;
            background: rgba(255,255,255,0.8);
            border-radius: 20px;
            font-size: 14px;
        }

        /* 关卡完成界面 */
        .level-complete {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0