<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Hello, world</title>
</head>
<body>
<main>
<h1>Hello, world.</h1>
<p>Every good idea starts somewhere.</p>
</main>
</body>
</html>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Pro Soccer Online 2.10.1 - Pro Physics & Height Edition</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
body { overflow: hidden; background: #111827; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
canvas { display: block; width: 100vw; height: 100vh; }
/* ================= MENU PRINCIPAL PSO ================= */
#main-menu {
position: absolute; inset: 0;
display: flex; flex-direction: column; justify-content: space-between;
padding: 14px 20px; z-index: 20;
background: linear-gradient(90deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 65%);
}
.top-bar { display: flex; align-items: center; justify-content: space-between; }
.version-box {
background: rgba(235, 242, 248, 0.92); color: #1b365d;
padding: 6px 14px; font-weight: 700; font-size: 14px; border-radius: 2px;
}
.nav-tabs {
display: flex; background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
border-radius: 2px; overflow: hidden; margin-right: 10%;
}
.nav-tab {
padding: 8px 32px; font-size: 15px; font-weight: 600; color: #1e3a8a;
cursor: pointer; border-right: 1px solid rgba(0,0,0,0.1);
}
.nav-tab.active, .nav-tab:hover { background: #ffffff; color: #0f172a; }
.discord-btn {
width: 38px; height: 38px; background: #5865F2; border-radius: 50%;
display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold;
}
.menu-grid {
display: flex; gap: 12px; margin-left: 30px; margin-top: -10px; width: 560px; max-width: 92vw;
}
.left-col { flex: 1.45; display: flex; flex-direction: column; gap: 10px; }
.right-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.mm-box {
background: rgba(22, 26, 30, 0.9); border: 1px solid rgba(255,255,255,0.2);
padding: 14px 12px; color: #fff; text-align: center;
}
.mm-title { font-size: 15px; margin-bottom: 12px; color: #e2e8f0; }
.shields-row { display: flex; justify-content: space-around; align-items: center; }
.shield-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shield {
width: 42px; height: 50px; border-radius: 4px 4px 22px 22px;
display: flex; align-items: center; justify-content: center;
font-weight: 800; font-size: 17px; border: 2px solid #94a3b8;
background: linear-gradient(180deg, #475569 0%, #1e293b 100%); color: #cbd5e1;
}
.shield.silver { border-color: #f8fafc; background: linear-gradient(180deg, #cbd5e1 0%, #64748b 100%); color: #fff; }
.shield.blue { border-color: #93c5fd; background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%); color: #fff; }
.shield-label { font-size: 11px; line-height: 1.2; color: #cbd5e1; }
.cards-bottom { display: flex; gap: 10px; height: 180px; }
.lobby-card, .train-btn {
flex: 1; border: 1px solid rgba(255,255,255,0.45);
background: linear-gradient(135deg, #475569 0%, #15803d 100%);
display: flex; align-items: center; justify-content: center; text-align: center;
color: #fff; font-weight: 800; font-size: 16px; cursor: pointer;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
box-shadow: 0 4px 10px rgba(0,0,0,0.4); transition: 0.15s;
}
.train-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.train-btn.single {
background: linear-gradient(135deg, #0284c7 0%, #16a34a 100%); border: 2px solid #7dd3fc;
}
.lobby-card:hover, .train-btn:hover { transform: scale(1.02); filter: brightness(1.1); }
.menu-btn {
flex: 1; background: linear-gradient(180deg, #f1f5f9 0%, #cbd5e1 100%);
border: 1px solid rgba(255,255,255,0.8); color: #1e3a8a;
font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center;
text-align: center; cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.menu-btn:hover { background: #ffffff; }
.profile-bar {
margin-left: 30px; width: 560px; max-width: 92vw;
background: rgba(235, 242, 248, 0.92); padding: 8px 14px;
display: flex; align-items: center; justify-content: space-between; border-radius: 2px;
}
.player-info { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #1e3a8a; font-size: 15px; }
.avatar-sq { width: 26px; height: 26px; background: #090d16; border: 1px solid #64748b; }
.stats-info { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; color: #1e3a8a; }
.lvl-bar { width: 45px; height: 6px; background: #cbd5e1; border-radius: 2px; overflow: hidden; margin-top: 2px; }
.lvl-fill { width: 40%; height: 100%; background: #2563eb; }
.bottom-bar { display: flex; justify-content: space-between; align-items: flex-end; }
.music-widget {
background: rgba(235, 242, 248, 0.88); padding: 6px 14px; border-radius: 2px;
display: flex; align-items: center; gap: 12px; color: #1e3a8a; font-size: 12px;
}
.party-btn { background: rgba(235, 242, 248, 0.92); color: #1e3a8a; font-weight: 700; padding: 8px 20px; border-radius: 2px; }
/* ================= HUD DO JOGO ================= */
#game-hud { display: none; position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#controls-panel {
position: absolute; top: 15px; left: 15px;
background: rgba(15, 23, 42, 0.85); color: #f8fafc;
padding: 12px 16px; border-radius: 8px; font-size: 12px; line-height: 1.55;
border: 1px solid rgba(255,255,255,0.18); pointer-events: auto;
}
#controls-panel b { color: #38bdf8; }
#scoreboard {
position: absolute; top: 15px; right: 20px;
background: rgba(15, 23, 42, 0.88); color: #fff;
padding: 10px 22px; border-radius: 8px; font-size: 22px; font-weight: 800;
border: 1px solid rgba(56, 189, 248, 0.45);
}
#lock-hint {
position: absolute; top: 70px; right: 20px;
background: rgba(22, 163, 74, 0.88); color: #fff;
padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
#crosshair {
position: absolute; top: 50%; left: 50%; width: 6px; height: 6px;
background: rgba(255,255,255,0.9); border: 1.2px solid #000;
border-radius: 50%; transform: translate(-50%, -50%);
}
#flick-telemetry {
position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%);
color: #fff; font-weight: 700; font-size: 12.5px;
background: rgba(0,0,0,0.72); padding: 4px 14px; border-radius: 12px;
white-space: nowrap; pointer-events: auto;
}
#power-wrap {
position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%);
width: 260px; height: 16px; background: rgba(0,0,0,0.75);
border: 2px solid #fff; border-radius: 99px; overflow: hidden;
}
#power-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); }
#stamina-wrap {
position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
width: 190px; height: 7px; background: rgba(0,0,0,0.75);
border: 1px solid rgba(255,255,255,0.5); border-radius: 99px; overflow: hidden;
}
#stamina-fill { width: 100%; height: 100%; background: #38bdf8; }
#goal-banner {
display: none; position: absolute; top: 26%; left: 50%; transform: translate(-50%, -50%);
font-size: 54px; font-weight: 900; color: #4ade80; text-shadow: 0 4px 20px rgba(0,0,0,0.9); letter-spacing: 3px;
}
/* Painel de Configurações de Altura e Curva */
.config-group { margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 6px; }
.config-group label { display: flex; justify-content: space-between; font-size: 11px; margin-top: 3px; }
.config-group input { width: 100px; cursor: pointer; }
</style>
</head>
<body oncontextmenu="return false;">
<!-- MENU PRINCIPAL -->
<div id="main-menu">
<div class="top-bar">
<div class="version-box">⚽ Pro Soccer Online 2.10.1</div>
<div class="nav-tabs">
<div class="nav-tab active">Main</div>
<div class="nav-tab">Community</div>
<div class="nav-tab">Extras</div>
<div class="nav-tab">Settings</div>
<div class="nav-tab">Exit</div>
</div>
<div class="discord-btn">🎮</div>
</div>
<div class="menu-grid">
<div class="left-col">
<div class="mm-box">
<div class="mm-title">MatchMaking</div>
<div class="shields-row">
<div class="shield-item"><div class="shield">-</div><div class="shield-label">3v3<br>Current</div></div>
<div class="shield-item"><div class="shield">-</div><div class="shield-label">3v3<br>All Time</div></div>
<div class="shield-item"><div class="shield silver">13</div><div class="shield-label">6v6<br>Current</div></div>
<div class="shield-item"><div class="shield blue">58</div><div class="shield-label">6v6<br>All Time</div></div>
</div>
</div>
<div class="cards-bottom">
<div class="lobby-card" onclick="startSingleplayer()">Custom<br>Lobbies</div>
<div class="train-col">
<div class="train-btn" onclick="startSingleplayer()">Multiplayer<br>Training</div>
<div class="train-btn single" onclick="startSingleplayer()">Singleplayer<br>Training</div>
</div>
</div>
</div>
<div class="right-col">
<div class="menu-btn">My Profile</div>
<div class="menu-btn">Player Search</div>
<div class="menu-btn">Leaderboards</div>
<div class="menu-btn">Player<br>Customization</div>
<div class="menu-btn">Team<br>Customization</div>
</div>
</div>
<div class="profile-bar">
<div class="player-info">
<div class="avatar-sq"></div>
<span>Macaco Da Shimano</span>
</div>
<div class="stats-info">
<div>Level 54<div class="lvl-bar"><div class="lvl-fill"></div></div></div>
<span>🟡 30</span>
<span>🟩 0</span>
</div>
</div>
<div class="bottom-bar">
<div class="music-widget">
<span>🔊 ━━━━━━●━━</span>
<div><b>Game On</b><br><span style="font-size:11px; color:#475569;">Casey Morgan</span></div>
</div>
<div class="party-btn">Party</div>
</div>
</div>
<!-- HUD DO JOGO -->
<div id="game-hud">
<div id="controls-panel">
<b>CONTROLES & CONFIG PSO:</b><br>
<b>W A S D</b> - Strafe | <b>Shift</b> - Sprint | <b>Espaço</b> - Pular<br>
<b>Botão Direito (Segurar)</b> - Condução Pro Soccer<br>
<b>Botão Esquerdo (Segurar + Flicar)</b> - Chutar<br>
• <b>Flick Cima/Baixo</b> = Height (Altura)<br>
• <b>Flick Esquerda/Direita</b> = Curva (Efeito)<br>
<b>V</b> - Câmera 1ª/3ª | <b>B</b> - Barreira | <b>R</b> - Resetar Bola
<div class="config-group">
<label>Sensibilidade Height (Altura): <span id="val-height">1.5x</span></label>
<input type="range" id="slider-height" min="0.5" max="3.0" step="0.1" value="1.5" oninput="updateSettings()">
<label>Sensibilidade Curva: <span id="val-curve">1.2x</span></label>
<input type="range" id="slider-curve" min="0.2" max="2.5" step="0.1" value="1.2" oninput="updateSettings()">
</div>
</div>
<div id="scoreboard">GOLS: <span id="goal-count" style="color:#4ade80;">0</span></div>
<div id="lock-hint">🔒 Mouse Ativo (Pressione ESC se necessário)</div>
<div id="goal-banner">GOLAÇO!</div>
<div id="crosshair"></div>
<div id="flick-telemetry">Condução: Solta | Chute com Flick pronto</div>
<div id="power-wrap"><div id="power-fill"></div></div>
<div id="stamina-wrap"><div id="stamina-fill"></div></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
let gameState = 'MENU';
// Configurações ajustáveis via HUD
let configHeightMultiplier = 1.5;
let configCurveMultiplier = 1.2;
function updateSettings() {
configHeightMultiplier = parseFloat(document.getElementById('slider-height').value);
configCurveMultiplier = parseFloat(document.getElementById('slider-curve').value);
document.getElementById('val-height').innerText = configHeightMultiplier.toFixed(1) + 'x';
document.getElementById('val-curve').innerText = configCurveMultiplier.toFixed(1) + 'x';
}
// --- CENA, CÂMERA E RENDER ---
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x7cc4fa);
scene.fog = new THREE.Fog(0x7cc4fa, 70, 210);
const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 350);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
document.body.appendChild(renderer.domElement);
// Iluminação
const hemiLight = new THREE.HemisphereLight(0xffffff, 0x2e7d32, 0.8);
scene.add(hemiLight);
const dirLight = new THREE.DirectionalLight(0xffffff, 0.95);
dirLight.position.set(45, 75, 35);
dirLight.castShadow = true;
dirLight.shadow.mapSize.width = 2048;
dirLight.shadow.mapSize.height = 2048;
dirLight.shadow.camera.near = 10;
dirLight.shadow.camera.far = 180;
const d = 55;
dirLight.shadow.camera.left = -d;
dirLight.shadow.camera.right = d;
dirLight.shadow.camera.top = d;
dirLight.shadow.camera.bottom = -d;
scene.add(dirLight);
// --- GRAMADO ---
const grassCanvas = document.createElement('canvas');
grassCanvas.width = 512; grassCanvas.height = 512;
const gCtx = grassCanvas.getContext('2d');
for (let i = 0; i < 8; i++) {
gCtx.fillStyle = i % 2 === 0 ? '#3a913f' : '#318036';
gCtx.fillRect(0, i * 64, 512, 64);
}
for (let i = 0; i < 8000; i++) {
gCtx.fillStyle = Math.random() > 0.5 ? 'rgba(255,255,255,0.035)' : 'rgba(0,0,0,0.045)';
gCtx.fillRect(Math.random()*512, Math.random()*512, 2, 2);
}
const grassTex = new THREE.CanvasTexture(grassCanvas);
grassTex.wrapS = THREE.RepeatWrapping; grassTex.wrapT = THREE.RepeatWrapping;
grassTex.repeat.set(6, 10);
const fieldW = 54, fieldL = 86;
const field = new THREE.Mesh(
new THREE.PlaneGeometry(fieldW + 16, fieldL + 16),
new THREE.MeshLambertMaterial({ map: grassTex })
);
field.rotation.x = -Math.PI / 2;
field.receiveShadow = true;
scene.add(field);
// Linhas do Campo
function addLine(w, l, x, z) {
const m = new THREE.Mesh(new THREE.PlaneGeometry(w, l), new THREE.MeshBasicMaterial({ color: 0xf8fafc }));
m.rotation.x = -Math.PI / 2; m.position.set(x, 0.02, z);
scene.add(m);
}
addLine(fieldW, 0.28, 0, -fieldL/2);
addLine(fieldW, 0.28, 0, fieldL/2);
addLine(0.28, fieldL, -fieldW/2, 0);
addLine(0.28, fieldL, fieldW/2, 0);
addLine(fieldW, 0.28, 0, 0);
addLine(24, 0.25, 0, -fieldL/2 + 13);
addLine(0.25, 13, -12, -fieldL/2 + 6.5);
addLine(0.25, 13, 12, -fieldL/2 + 6.5);
addLine(11, 0.25, 0, -fieldL/2 + 5);
addLine(0.25, 5, -5.5, -fieldL/2 + 2.5);
addLine(0.25, 5, 5.5, -fieldL/2 + 2.5);
// Arquibancadas
function buildCleanStand(w, tiers, x, z, rotY) {
const group = new THREE.Group();
const concreteMat = new THREE.MeshLambertMaterial({ color: 0x64748b });
const seatColors = [0x1e3a8a, 0x2563eb, 0xdc2626, 0xf8fafc];
for (let t = 0; t < tiers; t++) {
const step = new THREE.Mesh(new THREE.BoxGeometry(w, 1.1, 1.4), concreteMat);
step.position.set(0, t * 1.1 + 0.55, -t * 1.2);
group.add(step);
const seatRow = new THREE.Mesh(
new THREE.BoxGeometry(w - 0.5, 0.35, 0.6),
new THREE.MeshLambertMaterial({ color: seatColors[t % seatColors.length] })
);
seatRow.position.set(0, t * 1.1 + 1.15, -t * 1.2 + 0.2);
group.add(seatRow);
}
const backWall = new THREE.Mesh(new THREE.BoxGeometry(w, tiers * 1.1 + 3, 0.8), new THREE.MeshLambertMaterial({ color: 0x334155 }));
backWall.position.set(0, (tiers * 1.1 + 3)/2, -tiers * 1.2 - 0.4);
group.add(backWall);
const roof = new THREE.Mesh(new THREE.BoxGeometry(w + 2, 0.5, tiers * 1.3 + 3), new THREE.MeshLambertMaterial({ color: 0x1e293b }));
roof.position.set(0, tiers * 1.1 + 3.2, -tiers * 0.6 + 0.5);
group.add(roof);
group.position.set(x, 0, z); group.rotation.y = rotY;
scene.add(group);
}
buildCleanStand(80, 9, 0, -fieldL/2 - 9, 0);
buildCleanStand(80, 9, 0, fieldL/2 + 9, Math.PI);
buildCleanStand(102, 9, -fieldW/2 - 9, 0, Math.PI/2);
buildCleanStand(102, 9, fieldW/2 + 9, 0, -Math.PI/2);
// Bandeirinhas de escanteio
function addCornerFlag(x, z) {
const pole = new THREE.Mesh(new THREE.CylinderGeometry(0.035, 0.035, 1.45), new THREE.MeshBasicMaterial({ color: 0xffffff }));
pole.position.set(x, 0.72, z); scene.add(pole);
const flag = new THREE.Mesh(new THREE.PlaneGeometry(0.55, 0.36), new THREE.MeshBasicMaterial({ color: 0xef4444, side: THREE.DoubleSide }));
flag.position.set(x + 0.27, 1.26, z); scene.add(flag);
}
addCornerFlag(fieldW/2, -fieldL/2); addCornerFlag(-fieldW/2, -fieldL/2);
addCornerFlag(fieldW/2, fieldL/2); addCornerFlag(-fieldW/2, fieldL/2);
// --- TRAVES COM REDE ---
const goalW = 10.5, goalH = 3.6, goalZ = -fieldL/2;
const postMat = new THREE.MeshStandardMaterial({ color: 0xffffff, roughness: 0.25 });
function buildGoal(zPos) {
const p1 = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.14, goalH), postMat);
p1.position.set(-goalW/2, goalH/2, zPos); p1.castShadow = true; scene.add(p1);
const p2 = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.14, goalH), postMat);
p2.position.set(goalW/2, goalH/2, zPos); p2.castShadow = true; scene.add(p2);
const bar = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.14, goalW + 0.28), postMat);
bar.rotation.z = Math.PI/2; bar.position.set(0, goalH, zPos); bar.castShadow = true; scene.add(bar);
const netMat = new THREE.MeshBasicMaterial({ color: 0xffffff, wireframe: true, transparent: true, opacity: 0.4 });
const backNet = new THREE.Mesh(new THREE.PlaneGeometry(goalW, goalH, 18, 8), netMat);
backNet.position.set(0, goalH/2, zPos - 2.3); scene.add(backNet);
const topNet = new THREE.Mesh(new THREE.PlaneGeometry(goalW, 2.3, 18, 6), netMat);
topNet.rotation.x = Math.PI/2; topNet.position.set(0, goalH, zPos - 1.15); scene.add(topNet);
}
buildGoal(goalZ);
// --- BONECO SUPER REALISTA E ANATÔMICO ESTILO PRO SOCCER ---
function createProSoccerPlayer(options = {}) {
const skinColor = options.skin || 0x4b2f20;
const shirtColor = options.shirt || 0x16181d;
const shortsColor = options.shorts || 0x111317;
const hairColor = options.hair || 0xf45d3c;
const hasAfro = options.afro !== undefined ? options.afro : true;
const root = new THREE.Group();
const skinMat = new THREE.MeshStandardMaterial({ color: skinColor, roughness: 0.48 });
const shirtMat = new THREE.MeshStandardMaterial({ color: shirtColor, roughness: 0.65 });
const shortsMat = new THREE.MeshStandardMaterial({ color: shortsColor, roughness: 0.7 });
const sockMat = new THREE.MeshStandardMaterial({ color: 0x0f1115, roughness: 0.8 });
const bootMat = new THREE.MeshStandardMaterial({ color: 0x090b0e, roughness: 0.35 });
const whiteMat = new THREE.MeshBasicMaterial({ color: 0xffffff });
// Tronco e Peitoral
const chest = new THREE.Mesh(new THREE.CylinderGeometry(0.23, 0.185, 0.38, 22), shirtMat);
chest.position.y = 1.28; chest.scale.set(1.24, 1, 0.78); chest.castShadow = true;
root.add(chest);
const waist = new THREE.Mesh(new THREE.CylinderGeometry(0.185, 0.195, 0.25, 22), shirtMat);
waist.position.y = 0.98; waist.scale.set(1.14, 1, 0.78); waist.castShadow = true;
root.add(waist);
[-0.26, 0.26].forEach(sx => {
const shoulder = new THREE.Mesh(new THREE.SphereGeometry(0.098, 16, 16), shirtMat);
shoulder.position.set(sx, 1.41, 0); root.add(shoulder);
});
// Pescoço e Cabeça
const neck = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.085, 0.13, 16), skinMat);
neck.position.y = 1.50; root.add(neck);
const headGroup = new THREE.Group();
headGroup.position.set(0, 1.68, 0);
const cranium = new THREE.Mesh(new THREE.SphereGeometry(0.158, 24, 24), skinMat);
cranium.scale.set(0.90, 1.12, 0.96); cranium.castShadow = true; headGroup.add(cranium);
const jaw = new THREE.Mesh(new THREE.SphereGeometry(0.118, 16, 16), skinMat);
jaw.position.set(0, -0.06, 0.025); jaw.scale.set(0.88, 0.95, 0.92); headGroup.add(jaw);
const nose = new THREE.Mesh(new THREE.ConeGeometry(0.022, 0.055, 10), skinMat);
nose.rotation.x = 0.35; nose.position.set(0, -0.01, 0.155); headGroup.add(nose);
const browMat = new THREE.MeshBasicMaterial({ color: 0x1a110b });
[-0.048, 0.048].forEach(ex => {
const eye = new THREE.Mesh(new THREE.SphereGeometry(0.02, 10, 10), whiteMat);
eye.position.set(ex, 0.025, 0.138); headGroup.add(eye);
const pupil = new THREE.Mesh(new THREE.SphereGeometry(0.011, 10, 10), browMat);
pupil.position.set(ex, 0.025, 0.153); headGroup.add(pupil);
});
// Cabelo Afro Realista volumoso idêntico à print do PSO
if (hasAfro) {
const hairMat = new THREE.MeshStandardMaterial({ color: hairColor, roughness: 0.92 });
const afroBase = new THREE.Mesh(new THREE.SphereGeometry(0.25, 24, 24), hairMat);
afroBase.position.set(0, 0.09, -0.025); afroBase.scale.set(1.24, 0.95, 1.1);
afroBase.castShadow = true; headGroup.add(afroBase);
for (let i = 0; i < 30; i++) {
const ang = (i / 30) * Math.PI * 2;
const puff = new THREE.Mesh(new THREE.SphereGeometry(0.07, 10, 10), hairMat);
puff.position.set(Math.cos(ang)*0.245, 0.07 + Math.sin(i*1.7)*0.08, Math.sin(ang)*0.21 - 0.02);
headGroup.add(puff);
}
}
root.add(headGroup);
const hips = new THREE.Mesh(new THREE.CylinderGeometry(0.195, 0.205, 0.20, 20), shortsMat);
hips.position.y = 0.78; hips.scale.set(1.14, 1, 0.80); hips.castShadow = true;
root.add(hips);
// Braços
function makeArm(side) {
const shoulderPivot = new THREE.Group();
shoulderPivot.position.set(side * 0.29, 1.39, 0);
const sleeve = new THREE.Mesh(new THREE.CylinderGeometry(0.074, 0.07, 0.19, 14), shirtMat);
sleeve.position.y = -0.09; shoulderPivot.add(sleeve);
const upperArm = new THREE.Mesh(new THREE.CylinderGeometry(0.066, 0.058, 0.16, 14), skinMat);
upperArm.position.y = -0.24; upperArm.castShadow = true; shoulderPivot.add(upperArm);
const elbowPivot = new THREE.Group();
elbowPivot.position.y = -0.32; elbowPivot.rotation.x = -0.22;
const forearm = new THREE.Mesh(new THREE.CylinderGeometry(0.056, 0.044, 0.26, 14), skinMat);
forearm.position.y = -0.13; forearm.castShadow = true; elbowPivot.add(forearm);
const hand = new THREE.Mesh(new THREE.BoxGeometry(0.045, 0.09, 0.075), skinMat);
hand.position.y = -0.29; elbowPivot.add(hand);
shoulderPivot.add(elbowPivot);
shoulderPivot.rotation.z = side * 0.13;
root.add(shoulderPivot);
return { shoulder: shoulderPivot };
}
const leftArm = makeArm(-1);
const rightArm = makeArm(1);
// Pernas e Chuteiras
function makeLeg(side) {
const hipPivot = new THREE.Group();
hipPivot.position.set(side * 0.12, 0.74, 0);
const shortLeg = new THREE.Mesh(new THREE.CylinderGeometry(0.10, 0.09, 0.22, 16), shortsMat);
shortLeg.position.y = -0.10; shortLeg.castShadow = true; hipPivot.add(shortLeg);
const thigh = new THREE.Mesh(new THREE.CylinderGeometry(0.086, 0.072, 0.18, 16), skinMat);
thigh.position.y = -0.27; thigh.castShadow = true; hipPivot.add(thigh);
const kneePivot = new THREE.Group();
kneePivot.position.y = -0.36;
const shin = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.054, 0.16, 16), skinMat);
shin.position.y = -0.08; kneePivot.add(shin);
const sock = new THREE.Mesh(new THREE.CylinderGeometry(0.058, 0.048, 0.18, 16), sockMat);
sock.position.y = -0.24; sock.castShadow = true; kneePivot.add(sock);
const bootBody = new THREE.Mesh(new THREE.BoxGeometry(0.115, 0.085, 0.26), bootMat);
bootBody.position.set(0, -0.35, 0.045); bootBody.castShadow = true; kneePivot.add(bootBody);
const sole = new THREE.Mesh(new THREE.BoxGeometry(0.119, 0.02, 0.265), whiteMat);
sole.position.set(0, -0.39, 0.045); kneePivot.add(sole);
const laces = new THREE.Mesh(new THREE.PlaneGeometry(0.055, 0.10), whiteMat);
laces.rotation.x = -Math.PI / 2; laces.position.set(0, -0.306, 0.06); kneePivot.add(laces);
hipPivot.add(kneePivot);
root.add(hipPivot);
return { hip: hipPivot, knee: kneePivot };
}
const leftLeg = makeLeg(-1);
const rightLeg = makeLeg(1);
return { root, leftArm, rightArm, leftLeg, rightLeg };
}
// Jogador Principal
const player = createProSoccerPlayer({
skin: 0x4e3222, shirt: 0x16181d, shorts: 0x111317, hair: 0xf45d3c, afro: true
});
scene.add(player.root);
// Barreira de Falta com 4 Jogadores
const wallPlayers = [];
const wallGroup = new THREE.Group();
for (let i = 0; i < 4; i++) {
const wp = createProSoccerPlayer({
skin: i % 2 === 0 ? 0xc68642 : 0x5c3824,
shirt: 0xdc2626, shorts: 0xffffff, hair: 0x111111, afro: false
});
wp.root.position.set((i - 1.5) * 0.65, 0, 0);
wp.leftArm.shoulder.rotation.x = -0.55; wp.rightArm.shoulder.rotation.x = -0.55;
wallGroup.add(wp.root); wallPlayers.push(wp);
}
wallGroup.position.set(-1.3, 0, goalZ + 11.5);
scene.add(wallGroup);
// --- BOLA DE FUTEBOL MENOR E OFICIAL ---
const ballCanvas = document.createElement('canvas');
ballCanvas.width = 256; ballCanvas.height = 128;
const bCtx = ballCanvas.getContext('2d');
bCtx.fillStyle = '#ffffff'; bCtx.fillRect(0, 0, 256, 128);
bCtx.fillStyle = '#111827';
for (let x = 16; x < 256; x += 48) {
for (let y = 16; y < 128; y += 48) {
bCtx.beginPath(); bCtx.arc(x + (y%96===0?12:0), y, 11, 0, Math.PI*2); bCtx.fill();
}
}
const ballRadius = 0.23; // Raio menor e perfeito igual ao Pro Soccer Online!
const ball = new THREE.Mesh(
new THREE.SphereGeometry(ballRadius, 24, 24),
new THREE.MeshStandardMaterial({ map: new THREE.CanvasTexture(ballCanvas), roughness: 0.32 })
);
ball.castShadow = true;
scene.add(ball);
let ballPos = new THREE.Vector3();
let ballVel = new THREE.Vector3();
let ballSpinX = 0; // Curva lateral
let ballSpinY = 0; // Efeito de subida/queda
let goals = 0;
let wallJumpY = 0;
function setupMenuPose() {
player.root.position.set(fieldW/2 - 3.6, 0, -fieldL/2 + 4.2);
player.root.rotation.y = -0.45;
ballPos.set(fieldW/2 - 4.4, ballRadius, -fieldL/2 + 4.9);
ballVel.set(0, 0, 0);
ball.position.copy(ballPos);
}
setupMenuPose();
function startSingleplayer() {
gameState = 'PLAYING';
document.getElementById('main-menu').style.display = 'none';
document.getElementById('game-hud').style.display = 'block';
setupFreeKick(false);
}
function setupFreeKick(withWallFocus = true) {
if (withWallFocus) {
ballPos.set(-2.2, ballRadius, goalZ + 20.5);
player.root.position.set(-2.4, 0, goalZ + 22.8);
wallGroup.position.set(-1.3, 0, goalZ + 11.5);
yaw = 0.06;
} else {
ballPos.set(0, ballRadius, goalZ + 23);
player.root.position.set(0, 0, goalZ + 25.8);
wallGroup.position.set(-1.2, 0, goalZ + 12.2);
yaw = 0;
}
ballVel.set(0, 0, 0);
ballSpinX = 0; ballSpinY = 0;
pitch = 0.22;
isDribblingActive = false;
}
// --- CONTROLES E MECÂNICA DE FLICK (HEIGHT & CURVE) ---
const keys = {};
let yaw = 0, pitch = 0.22;
let firstPerson = false;
let isChargingKick = false;
let rightMouseHeld = false;
let isDribblingActive = false;
let kickPower = 0;
let stamina = 100;
let playerVelY = 0, isGrounded = true;
let walkCycle = 0;
let lastMouseX = null, lastMouseY = null;
let flickVelX = 0;
let flickVelY = 0;
const powerFill = document.getElementById('power-fill');
const staminaFill = document.getElementById('stamina-fill');
const flickTelemetry = document.getElementById('flick-telemetry');
const goalCount = document.getElementById('goal-count');
const goalBanner = document.getElementById('goal-banner');
window.addEventListener('mousemove', (e) => {
if (gameState !== 'PLAYING') return;
let dx = 0, dy = 0;
if (document.pointerLockElement === document.body) {
dx = e.movementX; dy = e.movementY;
} else {
if (lastMouseX !== null) { dx = e.clientX - lastMouseX; dy = e.clientY - lastMouseY; }
lastMouseX = e.clientX; lastMouseY = e.clientY;
}
yaw -= dx * 0.0028;
pitch = Math.max(-0.28, Math.min(1.05, pitch + dy * 0.0028));
// Captura o flick do mouse no instante do chute
flickVelX = flickVelX * 0.35 + dx * 0.65;
flickVelY = flickVelY * 0.35 + dy * 0.65;
});
window.addEventListener('keydown', (e) => {
keys[e.code] = true;
if (gameState !== 'PLAYING') return;
if (e.code === 'KeyR') setupFreeKick(false);
if (e.code === 'KeyB') setupFreeKick(true);
if (e.code === 'KeyV') { firstPerson = !firstPerson; player.root.visible = !firstPerson; }
if (e.code === 'Space' && isGrounded) { playerVelY = 7.4; isGrounded = false; }
});
window.addEventListener('keyup', (e) => { keys[e.code] = false; });
window.addEventListener('mousedown', (e) => {
if (gameState !== 'PLAYING') return;
if (e.button === 0) {
isChargingKick = true;
kickPower = 0.15;
flickVelX = 0; flickVelY = 0;
}
if (e.button === 2) { rightMouseHeld = true; }
});
window.addEventListener('mouseup', (e) => {
if (e.button === 0 && isChargingKick) {
executeProKick();
isChargingKick = false;
powerFill.style.width = '0%';
}
if (e.button === 2) { rightMouseHeld = false; isDribblingActive = false; }
});
// Chute com Flick para Altura (Height) e Curva
function executeProKick() {
const dist = player.root.position.distanceTo(ballPos);
if (dist < 2.5) {
isDribblingActive = false;
const forward = new THREE.Vector3(-Math.sin(yaw), 0, -Math.cos(yaw)).normalize();
const power = 15 + kickPower * 32;
// FLICK PARA CIMA (-dy) aumenta a Altura (Height) da bola proporcionalmente à configuração
const verticalFlick = -flickVelY; // Puxar o mouse para cima ao soltar gera altura
const baseHeight = Math.max(0.5, (0.5 - pitch) * 16);
const flickHeightBoost = Math.max(0, verticalFlick * 0.35 * configHeightMultiplier);
const lift = Math.min(24, baseHeight + flickHeightBoost * kickPower);
// FLICK LATERAL (flickVelX) aplica a Curva (Efeito Magnus)
const lateralFlick = Math.max(-50, Math.min(50, flickVelX));
const curveStrength = (lateralFlick / 50) * 26 * kickPower * configCurveMultiplier;
ballVel.x = forward.x * power;
ballVel.z = forward.z * power;
ballVel.y = lift;
ballSpinX = curveStrength;
ballSpinY = verticalFlick * 0.1;
flickTelemetry.innerText = `Chute Pro → Altura (Height): ${lift.toFixed(1)} | Curva: ${curveStrength.toFixed(1)}`;
wallJumpY = 4.8;
player.rightLeg.hip.rotation.x = -1.2;
player.rightLeg.knee.rotation.x = 0.25;
}
}
// --- LOOP PRINCIPAL ---
const clock = new THREE.Clock();
function animate() {
requestAnimationFrame(animate);
const dt = Math.min(clock.getDelta(), 0.05);
flickVelX *= 0.82;
flickVelY *= 0.82;
if (gameState === 'MENU') {
const px = player.root.position.x; const pz = player.root.position.z;
camera.position.set(px - 2.6, 1.48, pz + 3.1);
camera.lookAt(px - 1.35, 1.08, pz - 0.5);
player.leftArm.shoulder.rotation.x = Math.sin(clock.elapsedTime * 2) * 0.04;
player.rightArm.shoulder.rotation.x = -Math.sin(clock.elapsedTime * 2) * 0.04;
renderer.render(scene, camera);
return;
}
if (isChargingKick) {
kickPower = Math.min(1, kickPower + dt * 1.5);
powerFill.style.width = (kickPower * 100) + '%';
}
// Movimentação Strafe
const isSprinting = keys['ShiftLeft'] && stamina > 5;
const moveSpeed = isSprinting ? 11.2 : 7.0;
const forward = new THREE.Vector3(-Math.sin(yaw), 0, -Math.cos(yaw));
const right = new THREE.Vector3(Math.cos(yaw), 0, -Math.sin(yaw));
const move = new THREE.Vector3();
if (keys['KeyW']) move.add(forward);
if (keys['KeyS']) move.sub(forward);
if (keys['KeyD']) move.add(right);
if (keys['KeyA']) move.sub(right);
player.root.rotation.y = yaw + Math.PI;
const isMoving = move.lengthSq() > 0;
if (isMoving) {
move.normalize();
player.root.position.addScaledVector(move, moveSpeed * dt);
if (isSprinting) stamina = Math.max(0, stamina - 26 * dt);
else stamina = Math.min(100, stamina + 14 * dt);
walkCycle += dt * (isSprinting ? 16 : 11);
const legSwing = Math.sin(walkCycle) * 0.65;
player.leftLeg.hip.rotation.x = legSwing; player.rightLeg.hip.rotation.x = -legSwing;
player.leftLeg.knee.rotation.x = Math.max(0, -legSwing * 0.85); player.rightLeg.knee.rotation.x = Math.max(0, legSwing * 0.85);
player.leftArm.shoulder.rotation.x = -legSwing * 0.6; player.rightArm.shoulder.rotation.x = legSwing * 0.6;
} else {
stamina = Math.min(100, stamina + 20 * dt);
player.leftLeg.hip.rotation.x *= 0.8; player.rightLeg.hip.rotation.x *= 0.8;
player.leftLeg.knee.rotation.x *= 0.8; player.rightLeg.knee.rotation.x *= 0.8;
player.leftArm.shoulder.rotation.x *= 0.8; player.rightArm.shoulder.rotation.x *= 0.8;
}
staminaFill.style.width = stamina + '%';
player.root.position.y += playerVelY * dt;
if (player.root.position.y > 0) playerVelY -= 20 * dt;
else { player.root.position.y = 0; playerVelY = 0; isGrounded = true; }
// ================= CONDUÇÃO ESTILO PRO SOCCER =================
const distToBall = player.root.position.distanceTo(ballPos);
if (rightMouseHeld && !isChargingKick) {
if (distToBall < 2.1 && ballPos.y < 1.2) { isDribblingActive = true; }
} else {
isDribblingActive = false;
}
if (isDribblingActive) {
if (distToBall > 2.6) {
isDribblingActive = false;
} else {
const targetBallPos = new THREE.Vector3(
player.root.position.x + forward.x * 0.85,
ballRadius,
player.root.position.z + forward.z * 0.85
);
const pullFactor = Math.min(1, dt * 18);
const prevPos = ballPos.clone();
ballPos.lerp(targetBallPos, pullFactor);
ballVel.subVectors(ballPos, prevPos).divideScalar(Math.max(dt, 0.001));
ballVel.y = 0;
ballSpinX = 0; ballSpinY = 0;
if (!isChargingKick) flickTelemetry.innerText = 'Condução: ATIVA (Botão Direito Pressionado)';
}
} else {
// --- FÍSICA DA BOLA ---
ballVel.y -= 19.5 * dt;
if (Math.abs(ballSpinX) > 0.02 && ballVel.length() > 1.8) {
const perp = new THREE.Vector3(-ballVel.z, 0, ballVel.x).normalize();
ballVel.addScaledVector(perp, ballSpinX * dt);
ballSpinX *= 0.992;
}
ballPos.addScaledVector(ballVel, dt);
if (ballPos.y <= ballRadius) {
ballPos.y = ballRadius;
ballVel.y = ballVel.y < -1.4 ? -ballVel.y * 0.62 : 0;
ballVel.x *= Math.pow(0.46, dt);
ballVel.z *= Math.pow(0.46, dt);
} else {
ballVel.x *= Math.pow(0.86, dt);
ballVel.z *= Math.pow(0.86, dt);
}
}
// --- BARREIRA ---
if (wallGroup.position.y > 0 || wallJumpY > 0) {
wallGroup.position.y += wallJumpY * dt; wallJumpY -= 16 * dt;
if (wallGroup.position.y <= 0) { wallGroup.position.y = 0; wallJumpY = 0; }
}
wallPlayers.forEach(wp => {
const worldX = wallGroup.position.x + wp.root.position.x;
const worldZ = wallGroup.position.z + wp.root.position.z;
const wallTop = wallGroup.position.y + 1.95;
if (Math.abs(ballPos.x - worldX) < 0.45 && Math.abs(ballPos.z - worldZ) < 0.45 && ballPos.y < wallTop) {
isDribblingActive = false;
ballVel.z = Math.abs(ballVel.z) * 0.55 + 2.5;
ballVel.x += (Math.random() - 0.5) * 5;
ballPos.z = worldZ + 0.5;
}
});
// --- GOL ---
if (ballPos.z < goalZ && Math.abs(ballPos.x) < goalW/2 && ballPos.y < goalH) {
goals++;
goalCount.innerText = goals;
goalBanner.style.display = 'block';
setTimeout(() => goalBanner.style.display = 'none', 1400);
setupFreeKick(true);
} else if (Math.abs(ballPos.x) > fieldW/2 + 4 || Math.abs(ballPos.z) > fieldL/2 + 4) {
setupFreeKick(false);
}
ball.position.copy(ballPos);
ball.rotation.x += ballVel.z * dt * 2.5;
ball.rotation.z -= ballVel.x * dt * 2.5;
// --- CÂMERA ---
if (firstPerson) {
camera.position.set(player.root.position.x, player.root.position.y + 1.68, player.root.position.z);
const lookTarget = new THREE.Vector3(
camera.position.x - Math.sin(yaw) * 10,
camera.position.y - pitch * 8,
camera.position.z - Math.cos(yaw) * 10
);
camera.lookAt(lookTarget);
} else {
const camDist = 5.4;
const camHeight = 1.65 + Math.sin(pitch) * 3.8;
camera.position.x = player.root.position.x + Math.sin(yaw) * camDist * Math.cos(pitch);
camera.position.z = player.root.position.z + Math.cos(yaw) * camDist * Math.cos(pitch);
camera.position.y = player.root.position.y + camHeight;
camera.lookAt(player.root.position.x, player.root.position.y + 1.35, player.root.position.z);
}
renderer.render(scene, camera);
}
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
animate();
</script>
</body>
</html>