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; 
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: #1a1a2e;
        }
        canvas { display: block; }
        
        #ui-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        
        #info-panel {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.75);
            color: #fff;
            padding: 15px 30px;
            border-radius: 15px;
            font-size: 18px;
            text-align: center;
            pointer-events: auto;
            border: 2px solid rgba(255,255,255,0.2);
            backdrop-filter: blur(10px);
            min-width: 300px;
        }
        
        #info-panel .turn-indicator {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .player1-color { color: #ff4444; }
        .player2-color { color: #4488ff; }
        
        #dice-panel {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            text-align: center;
            pointer-events: auto;
        }
        
        #roll-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 50px;
            font-size: 22px;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 5px 20px rgba(102,126,234,0.4);
            font-weight: bold;
            letter-spacing: 2px;
        }
        
        #roll-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 30px rgba(102,126,234,0.6);
        }
        
        #roll-btn:disabled {
            background: linear-gradient(135deg, #555 0%, #333 100%);
            cursor: not-allowed;
            transform: scale(1);
            box-shadow: none;
        }
        
        #dice-result {
            font-size: 60px;
            color: #fff;
            margin-bottom: 15px;
            text-shadow: 0 0 20px rgba(255,255,255,0.5);
            height: 80px;
            line-height: 80px;
        }
        
        #player-panels {
            position: absolute;
            top: 100px;
            left: 20px;
            pointer-events: auto;
        }
        
        .player-card {
            background: rgba(0,0,0,0.7);
            padding: 15px 20px;
            border-radius: 12px;
            margin-bottom: 10px;
            min-width: 180px;
            border: 2px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            color: #ccc;
        }
        
        .player-card.active {
            border-color: #667eea;
            box-shadow: 0 0 20px rgba(102,126,234,0.3);
        }
        
        .player-card h3 {
            margin-bottom: 8px;
            font-size: 16px;
        }
        
        .player-card .pieces-info {
            font-size: 13px;
            line-height: 1.8;
        }
        
        #message {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0,0,0,0.9);
            color: #fff;
            padding: 30px 50px;
            border-radius: 20px;
            font-size: 28px;
            text-align: center;
            display: none;
            pointer-events: auto;
            border: 2px solid #667eea;
            z-index: 100;
        }
        
        #message button {
            margin-top: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 10px 30px;
            font-size: 18px;
            border-radius: 25px;
            cursor: pointer;
        }
        
        #piece-select {
            position: absolute;
            bottom: 130px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            pointer-events: auto;
            text-align: center;
        }
        
        #piece-select .title {
            color: #fff;
            margin-bottom: 10px;
            font-size: 16px;
        }
        
        .piece-btn {
            background: rgba(255,255,255,0.15);
            color: white;
            border: 2px solid rgba(255,255,255,0.3);
            padding: 10px 20px;
            margin: 0 5px;
            font-size: 15px;
            border-radius: 10px;
            cu.........完整代码请登录后点击上方下载按钮下载查看

网友评论0