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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import webbrowser
|
| 2 |
+
import tempfile
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
html_content = """
|
| 6 |
+
<!DOCTYPE html>
|
| 7 |
+
<html lang="tr">
|
| 8 |
+
<head>
|
| 9 |
+
<meta charset="UTF-8">
|
| 10 |
+
<title>ULTRAKILL 3D: UNREAL PUPPET CHRONICLES</title>
|
| 11 |
+
<style>
|
| 12 |
+
body {
|
| 13 |
+
margin: 0;
|
| 14 |
+
overflow: hidden;
|
| 15 |
+
background-color: #020000;
|
| 16 |
+
font-family: 'Courier New', monospace;
|
| 17 |
+
user-select: none;
|
| 18 |
+
}
|
| 19 |
+
#canvas-container {
|
| 20 |
+
width: 100vw;
|
| 21 |
+
height: 100vh;
|
| 22 |
+
}
|
| 23 |
+
#hud {
|
| 24 |
+
position: absolute;
|
| 25 |
+
bottom: 20px;
|
| 26 |
+
left: 50%;
|
| 27 |
+
transform: translateX(-50%);
|
| 28 |
+
width: 90%;
|
| 29 |
+
max-width: 950px;
|
| 30 |
+
background: rgba(5, 5, 5, 0.95);
|
| 31 |
+
border: 2px solid #00ffcc;
|
| 32 |
+
border-radius: 8px;
|
| 33 |
+
display: flex;
|
| 34 |
+
justify-content: space-around;
|
| 35 |
+
padding: 18px;
|
| 36 |
+
color: #00ffcc;
|
| 37 |
+
font-size: 18px;
|
| 38 |
+
font-weight: bold;
|
| 39 |
+
box-shadow: 0 0 35px rgba(0, 255, 204, 0.4);
|
| 40 |
+
pointer-events: none;
|
| 41 |
+
z-index: 10;
|
| 42 |
+
}
|
| 43 |
+
.hud-item span {
|
| 44 |
+
color: #fff;
|
| 45 |
+
}
|
| 46 |
+
#crosshair {
|
| 47 |
+
position: absolute;
|
| 48 |
+
top: 50%;
|
| 49 |
+
left: 50%;
|
| 50 |
+
width: 16px;
|
| 51 |
+
height: 16px;
|
| 52 |
+
transform: translate(-50%, -50%);
|
| 53 |
+
pointer-events: none;
|
| 54 |
+
z-index: 10;
|
| 55 |
+
}
|
| 56 |
+
#crosshair::before, #crosshair::after {
|
| 57 |
+
content: '';
|
| 58 |
+
position: absolute;
|
| 59 |
+
background: #ff0055;
|
| 60 |
+
}
|
| 61 |
+
#crosshair::before { top: 7px; left: -10px; width: 36px; height: 2px; }
|
| 62 |
+
#crosshair::after { top: -10px; left: 7px; width: 2px; height: 36px; }
|
| 63 |
+
|
| 64 |
+
#instructions {
|
| 65 |
+
position: absolute;
|
| 66 |
+
top: 10px;
|
| 67 |
+
left: 10px;
|
| 68 |
+
color: #ccc;
|
| 69 |
+
font-size: 13px;
|
| 70 |
+
background: rgba(0,0,0,0.9);
|
| 71 |
+
padding: 15px;
|
| 72 |
+
border: 1px solid #333;
|
| 73 |
+
border-radius: 5px;
|
| 74 |
+
pointer-events: none;
|
| 75 |
+
z-index: 10;
|
| 76 |
+
}
|
| 77 |
+
#biome-alert {
|
| 78 |
+
position: absolute;
|
| 79 |
+
top: 30px;
|
| 80 |
+
left: 50%;
|
| 81 |
+
transform: translateX(-50%);
|
| 82 |
+
color: #00ffcc;
|
| 83 |
+
font-size: 26px;
|
| 84 |
+
font-weight: bold;
|
| 85 |
+
text-shadow: 0 0 15px #00ff88;
|
| 86 |
+
background: rgba(0,0,0,0.8);
|
| 87 |
+
padding: 12px 24px;
|
| 88 |
+
border-radius: 5px;
|
| 89 |
+
pointer-events: none;
|
| 90 |
+
display: none;
|
| 91 |
+
z-index: 10;
|
| 92 |
+
}
|
| 93 |
+
#click-to-play {
|
| 94 |
+
position: absolute;
|
| 95 |
+
width: 100%;
|
| 96 |
+
height: 100%;
|
| 97 |
+
background: rgba(3,0,5,0.97);
|
| 98 |
+
display: flex;
|
| 99 |
+
flex-direction: column;
|
| 100 |
+
justify-content: center;
|
| 101 |
+
align-items: center;
|
| 102 |
+
color: #00ffcc;
|
| 103 |
+
cursor: pointer;
|
| 104 |
+
z-index: 99;
|
| 105 |
+
}
|
| 106 |
+
.btn-play {
|
| 107 |
+
font-size: 24px;
|
| 108 |
+
background: #00ffcc;
|
| 109 |
+
color: #000;
|
| 110 |
+
font-weight: bold;
|
| 111 |
+
border: none;
|
| 112 |
+
padding: 15px 50px;
|
| 113 |
+
margin-top: 25px;
|
| 114 |
+
font-family: inherit;
|
| 115 |
+
cursor: pointer;
|
| 116 |
+
box-shadow: 0 0 20px #00ffcc;
|
| 117 |
+
border-radius: 5px;
|
| 118 |
+
}
|
| 119 |
+
</style>
|
| 120 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
| 121 |
+
</head>
|
| 122 |
+
<body>
|
| 123 |
+
|
| 124 |
+
<div id="click-to-play">
|
| 125 |
+
<h1 style="font-size: 55px; text-shadow: 0 0 25px #00ffcc; margin-bottom: 5px; letter-spacing: 2px;">ULTRAKILL 3D</h1>
|
| 126 |
+
<h3 style="color: #888; margin-bottom: 25px; letter-spacing: 1px;">UNREAL ENGINE DEV PUPPET WORLD (1000x SCALE)</h3>
|
| 127 |
+
<button class="btn-play">DÜNYAYA GİRİŞ YAP</button>
|
| 128 |
+
<p style="font-size: 13px; color: #666; margin-top: 15px;">Etrafına bakmak için mouse kilitle. Çıkmak için ESC.</p>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div id="instructions">
|
| 132 |
+
<b>KONTROLLER:</b><br>
|
| 133 |
+
• WASD: Ultra Hızlı Hareket<br>
|
| 134 |
+
• SPACE: Süper Yerçekimi Zıplaması (Devasa parkurlar için)<br>
|
| 135 |
+
• SOL TIK: Ateş Et (Geri Tepmeli Silah)<br>
|
| 136 |
+
• R: Şarjör Doldur | F: Kan Emerek Canlan<br><br>
|
| 137 |
+
<b>DEVASA BİYOMLAR (1000x):</b><br>
|
| 138 |
+
<span style="color: #55ff55;">• ORMAN (Z: 100 -> 3000)</span> - Sopalı & Glock Kuklaları<br>
|
| 139 |
+
<span style="color: #ffcc00;">• ÇÖL (Z: -100 -> -3000)</span> - Dinamitçiler & ALTIN BOSS KUKLASI<br>
|
| 140 |
+
<span style="color: #ff3333;">• MAĞARA (Y: -100 Altı)</span> - KIZIL MAĞARA BOSSU
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<div id="biome-alert">BİYOM DEĞİŞTİ</div>
|
| 144 |
+
<div id="crosshair"></div>
|
| 145 |
+
|
| 146 |
+
<div id="hud">
|
| 147 |
+
<div class="hud-item">CAN: <span id="hp">250</span>/250</div>
|
| 148 |
+
<div class="hud-item">EMİLEN KAN: <span id="blood" style="color: #ff3355; text-shadow: 0 0 5px #f05;">0</span></div>
|
| 149 |
+
<div class="hud-item">SİLAH: <span id="weapon" style="color: #00ffcc;">Atom Tabancası</span></div>
|
| 150 |
+
<div class="hud-item">ŞARJÖR: <span id="ammo">12/12</span></div>
|
| 151 |
+
</div>
|
| 152 |
+
|
| 153 |
+
<div id="canvas-container"></div>
|
| 154 |
+
|
| 155 |
+
<script>
|
| 156 |
+
let scene, camera, renderer;
|
| 157 |
+
let moveForward = false, moveBackward = false, moveLeft = false, moveRight = false;
|
| 158 |
+
let canJump = false;
|
| 159 |
+
let velocity = new THREE.Vector3();
|
| 160 |
+
let direction = new THREE.Vector3();
|
| 161 |
+
|
| 162 |
+
const player = {
|
| 163 |
+
hp: 250,
|
| 164 |
+
maxHp: 250,
|
| 165 |
+
blood: 0,
|
| 166 |
+
weapon: 'atom',
|
| 167 |
+
ammo: { atom: 12, atomMax: 12, shotgun: 5, shotgunMax: 5 }
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
const GRAVITY = 15.0;
|
| 171 |
+
const JUMP_FORCE = 12.0;
|
| 172 |
+
|
| 173 |
+
let enemies = [];
|
| 174 |
+
let bullets = [];
|
| 175 |
+
let enemyBullets = [];
|
| 176 |
+
let bloodDrops = [];
|
| 177 |
+
let ammoPickups = [];
|
| 178 |
+
let dynamites = [];
|
| 179 |
+
let parkours = [];
|
| 180 |
+
|
| 181 |
+
// 3D Silahlar
|
| 182 |
+
let gunGroup;
|
| 183 |
+
let atomGunMesh, shotgunMesh;
|
| 184 |
+
|
| 185 |
+
const clickToPlay = document.getElementById('click-to-play');
|
| 186 |
+
const container = document.getElementById('canvas-container');
|
| 187 |
+
const alertBox = document.getElementById('biome-alert');
|
| 188 |
+
|
| 189 |
+
let isLocked = false;
|
| 190 |
+
clickToPlay.addEventListener('click', () => { container.requestPointerLock(); });
|
| 191 |
+
|
| 192 |
+
document.addEventListener('pointerlockchange', () => {
|
| 193 |
+
if (document.pointerLockElement === container) {
|
| 194 |
+
clickToPlay.style.display = 'none';
|
| 195 |
+
isLocked = true;
|
| 196 |
+
} else {
|
| 197 |
+
clickToPlay.style.display = 'flex';
|
| 198 |
+
isLocked = false;
|
| 199 |
+
}
|
| 200 |
+
});
|
| 201 |
+
|
| 202 |
+
document.addEventListener('keydown', (e) => {
|
| 203 |
+
switch (e.code) {
|
| 204 |
+
case 'KeyW': moveForward = true; break;
|
| 205 |
+
case 'KeyS': moveBackward = true; break;
|
| 206 |
+
case 'KeyA': moveLeft = true; break;
|
| 207 |
+
case 'KeyD': moveRight = true; break;
|
| 208 |
+
case 'Space':
|
| 209 |
+
if (canJump) {
|
| 210 |
+
velocity.y += JUMP_FORCE;
|
| 211 |
+
canJump = false;
|
| 212 |
+
}
|
| 213 |
+
break;
|
| 214 |
+
case 'KeyR': reloadWeapon(); break;
|
| 215 |
+
case 'KeyF': consumeBlood(); break;
|
| 216 |
+
}
|
| 217 |
+
});
|
| 218 |
+
|
| 219 |
+
document.addEventListener('keyup', (e) => {
|
| 220 |
+
switch (e.code) {
|
| 221 |
+
case 'KeyW': moveForward = false; break;
|
| 222 |
+
case 'KeyS': moveBackward = false; break;
|
| 223 |
+
case 'KeyA': moveLeft = false; break;
|
| 224 |
+
case 'KeyD': moveRight = false; break;
|
| 225 |
+
}
|
| 226 |
+
});
|
| 227 |
+
|
| 228 |
+
document.addEventListener('mousemove', (e) => {
|
| 229 |
+
if (!isLocked) return;
|
| 230 |
+
camera.rotation.y -= e.movementX * 0.002;
|
| 231 |
+
camera.rotation.x -= e.movementY * 0.002;
|
| 232 |
+
camera.rotation.x = Math.max(-Math.PI / 2.3, Math.min(Math.PI / 2.3, camera.rotation.x));
|
| 233 |
+
});
|
| 234 |
+
|
| 235 |
+
document.addEventListener('mousedown', (e) => {
|
| 236 |
+
if (isLocked && e.button === 0) fireWeapon();
|
| 237 |
+
});
|
| 238 |
+
|
| 239 |
+
init();
|
| 240 |
+
animate();
|
| 241 |
+
|
| 242 |
+
function init() {
|
| 243 |
+
scene = new THREE.Scene();
|
| 244 |
+
scene.background = new THREE.Color(0x020102);
|
| 245 |
+
scene.fog = new THREE.FogExp2(0x040306, 0.0008); // Harita 1000 kat büyüdüğü için görüş mesafesini genişlettik
|
| 246 |
+
|
| 247 |
+
camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 10000);
|
| 248 |
+
camera.position.set(0, 5, 200);
|
| 249 |
+
camera.rotation.order = 'YXZ';
|
| 250 |
+
|
| 251 |
+
const ambient = new THREE.AmbientLight(0x00ffff, 0.2);
|
| 252 |
+
scene.add(ambient);
|
| 253 |
+
|
| 254 |
+
const sunLight = new THREE.DirectionalLight(0xffeedd, 1.0);
|
| 255 |
+
sunLight.position.set(100, 500, 100);
|
| 256 |
+
scene.add(sunLight);
|
| 257 |
+
|
| 258 |
+
// 3D SİLAH MODELLERİ
|
| 259 |
+
gunGroup = new THREE.Group();
|
| 260 |
+
|
| 261 |
+
// Atom Tabancası
|
| 262 |
+
const atomBody = new THREE.Mesh(new THREE.BoxGeometry(0.12, 0.15, 0.6), new THREE.MeshStandardMaterial({ color: 0x222222, metalness: 0.8 }));
|
| 263 |
+
const atomBarrel = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.04, 0.5), new THREE.MeshStandardMaterial({ color: 0x00ffcc, emissive: 0x00ffcc }));
|
| 264 |
+
atomBarrel.rotation.x = Math.PI / 2;
|
| 265 |
+
atomBarrel.position.set(0, 0.04, -0.3);
|
| 266 |
+
atomBody.add(atomBarrel);
|
| 267 |
+
atomGunMesh = atomBody;
|
| 268 |
+
gunGroup.add(atomGunMesh);
|
| 269 |
+
|
| 270 |
+
// Pompalı
|
| 271 |
+
const sgBody = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.18, 0.8), new THREE.MeshStandardMaterial({ color: 0x111111, roughness: 0.6 }));
|
| 272 |
+
const sgBarrel = new THREE.Mesh(new THREE.CylinderGeometry(0.08, 0.08, 0.7), new THREE.MeshStandardMaterial({ color: 0xff0055, emissive: 0x550011 }));
|
| 273 |
+
sgBarrel.rotation.x = Math.PI / 2;
|
| 274 |
+
sgBarrel.position.set(0, 0.04, -0.4);
|
| 275 |
+
sgBody.add(sgBarrel);
|
| 276 |
+
shotgunMesh = sgBody;
|
| 277 |
+
shotgunMesh.visible = false;
|
| 278 |
+
gunGroup.add(shotgunMesh);
|
| 279 |
+
|
| 280 |
+
gunGroup.position.set(0.3, -0.25, -0.5);
|
| 281 |
+
camera.add(gunGroup);
|
| 282 |
+
scene.add(camera);
|
| 283 |
+
|
| 284 |
+
// DEVASA BÖLGELER (ZEMİNLER) - Önceki haritadan 1000 Kat Büyük
|
| 285 |
+
// Orman Alanı (Z: 0'dan 3000'e kadar)
|
| 286 |
+
createGround(0, 0, 1500, 5000, 3000, 0x071e07);
|
| 287 |
+
// Çöl Alanı (Z: 0'dan -3000'e kadar)
|
| 288 |
+
createGround(0, 0, -1500, 5000, 3000, 0xbf9440);
|
| 289 |
+
// Yer Altı Mağarası (Y: -100 katında devasa bir dünya)
|
| 290 |
+
createGround(0, -100, 0, 4000, 4000, 0x150101);
|
| 291 |
+
|
| 292 |
+
// ORMAN DEKORASYONLARI
|
| 293 |
+
for (let i = 0; i < 200; i++) {
|
| 294 |
+
createTree((Math.random() - 0.5) * 3500, Math.random() * 2500 + 100);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
// ÇÖL DEKORASYONLARI
|
| 298 |
+
for (let i = 0; i < 150; i++) {
|
| 299 |
+
createCactus((Math.random() - 0.5) * 3500, -Math.random() * 2500 - 100);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
// DEV PARKURLAR & HARABELER
|
| 303 |
+
createParkour(0, 15, 100, 25, 30, 25);
|
| 304 |
+
createParkour(-100, 30, 50, 20, 60, 20);
|
| 305 |
+
createParkour(120, 45, -50, 30, 90, 30);
|
| 306 |
+
createParkour(0, 60, -200, 50, 120, 50); // Çöle geçişteki devasa Unreal Gözlem Kulesi
|
| 307 |
+
|
| 308 |
+
// Mağara İniş Kuyusu ve Parkur Merdivenleri
|
| 309 |
+
createParkour(-400, -20, 100, 80, 40, 80);
|
| 310 |
+
createParkour(-400, -60, -50, 60, 60, 60);
|
| 311 |
+
|
| 312 |
+
// KUKLA DÜŞMANLARI YERLEŞTİR (Sürekli devriye gezecekler)
|
| 313 |
+
for (let i = 0; i < 15; i++) spawnPuppet('sopali', (Math.random() - 0.5) * 2000, 1, Math.random() * 2000 + 200);
|
| 314 |
+
for (let i = 0; i < 12; i++) spawnPuppet('glock', (Math.random() - 0.5) * 2000, 1, Math.random() * 2000 + 200);
|
| 315 |
+
for (let i = 0; i < 15; i++) spawnPuppet('insan', (Math.random() - 0.5) * 3000, 1, (Math.random() - 0.5) * 3000);
|
| 316 |
+
for (let i = 0; i < 15; i++) spawnPuppet('haydut', (Math.random() - 0.5) * 2000, 1, -Math.random() * 2000 - 200);
|
| 317 |
+
|
| 318 |
+
// BÜYÜK BOSS'LAR
|
| 319 |
+
spawnPuppet('desert_boss', 0, 4, -1000); // Çöl Boss'u dev kulede bekliyor
|
| 320 |
+
spawnPuppet('cave_boss', 0, -96, 0); // Mağara Boss'u yer altında
|
| 321 |
+
|
| 322 |
+
renderer = new THREE.WebGLRenderer({ antialias: true });
|
| 323 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 324 |
+
renderer.shadowMap.enabled = true;
|
| 325 |
+
container.appendChild(renderer.domElement);
|
| 326 |
+
|
| 327 |
+
window.addEventListener('resize', onWindowResize);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
function createGround(x, y, z, w, d, col) {
|
| 331 |
+
const geo = new THREE.BoxGeometry(w, 2, d);
|
| 332 |
+
const mat = new THREE.MeshStandardMaterial({ color: col, roughness: 0.9, metalness: 0.1 });
|
| 333 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 334 |
+
mesh.position.set(x, y - 1, z);
|
| 335 |
+
scene.add(mesh);
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
function createTree(x, z) {
|
| 339 |
+
const trunkGeo = new THREE.CylinderGeometry(1.5, 2.0, 30, 8);
|
| 340 |
+
const trunkMat = new THREE.MeshStandardMaterial({ color: 0x331c0e });
|
| 341 |
+
const trunk = new THREE.Mesh(trunkGeo, trunkMat);
|
| 342 |
+
trunk.position.set(x, 15, z);
|
| 343 |
+
|
| 344 |
+
const leavesGeo = new THREE.ConeGeometry(12, 40, 8);
|
| 345 |
+
const leavesMat = new THREE.MeshStandardMaterial({ color: 0x0b3211, roughness: 0.8 });
|
| 346 |
+
const leaves = new THREE.Mesh(leavesGeo, leavesMat);
|
| 347 |
+
leaves.position.y = 25;
|
| 348 |
+
trunk.add(leaves);
|
| 349 |
+
|
| 350 |
+
scene.add(trunk);
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
function createCactus(x, z) {
|
| 354 |
+
const mainGeo = new THREE.CylinderGeometry(2, 2, 25, 8);
|
| 355 |
+
const mainMat = new THREE.MeshStandardMaterial({ color: 0x2e501c });
|
| 356 |
+
const main = new THREE.Mesh(mainGeo, mainMat);
|
| 357 |
+
main.position.set(x, 12.5, z);
|
| 358 |
+
scene.add(main);
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
function createParkour(x, y, z, w, h, d) {
|
| 362 |
+
const geo = new THREE.BoxGeometry(w, h, d);
|
| 363 |
+
const mat = new THREE.MeshStandardMaterial({ color: 0x2c2c35, roughness: 0.5, metalness: 0.6 });
|
| 364 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 365 |
+
mesh.position.set(x, y, z);
|
| 366 |
+
scene.add(mesh);
|
| 367 |
+
parkours.push(mesh);
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
// UNREAL ENGINE KUKLA MODELLEME (Robotik Cansız Manken Tasarımı)
|
| 371 |
+
function spawnPuppet(type, x, y, z) {
|
| 372 |
+
let hp = 50, col = 0xd1d5db, sizeScale = 1.0;
|
| 373 |
+
let nameLabel = "KUKLA";
|
| 374 |
+
|
| 375 |
+
if (type === 'glock') { hp = 90; col = 0x3b82f6; nameLabel = "GLOCK'LU KUKLA"; }
|
| 376 |
+
else if (type === 'haydut') { hp = 100; col = 0xf97316; nameLabel = "DİNAMİTÇİ HAYDUT"; }
|
| 377 |
+
else if (type === 'desert_boss') { hp = 1500; col = 0xeab308; sizeScale = 4.0; nameLabel = "!!! ÇÖL BOSS'U !!!"; }
|
| 378 |
+
else if (type === 'cave_boss') { hp = 2000; col = 0xef4444; sizeScale = 5.0; nameLabel = "!!! MAĞARA MUHAFIZI !!!"; }
|
| 379 |
+
else if (type === 'insan') { hp = 30; col = 0x10b981; nameLabel = "MASUM KUKLA"; }
|
| 380 |
+
else if (type === 'sopali') { hp = 70; col = 0x6b7280; nameLabel = "SOPALI KUKLA"; }
|
| 381 |
+
|
| 382 |
+
const group = new THREE.Group();
|
| 383 |
+
|
| 384 |
+
// Unreal Test Kuklası Anatomisi (Eklem-Sütun Yapısı)
|
| 385 |
+
const mat = new THREE.MeshStandardMaterial({ color: col, roughness: 0.4, metalness: 0.5 });
|
| 386 |
+
|
| 387 |
+
// Gövde (Torso)
|
| 388 |
+
const torso = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.3, 1.4, 10), mat);
|
| 389 |
+
torso.position.y = 1.6;
|
| 390 |
+
group.add(torso);
|
| 391 |
+
|
| 392 |
+
// Kafa (Küre şeklinde parlak vizörlü)
|
| 393 |
+
const head = new THREE.Mesh(new THREE.SphereGeometry(0.35, 12, 12), mat);
|
| 394 |
+
head.position.y = 2.5;
|
| 395 |
+
|
| 396 |
+
// Neon Vizör Çizgisi
|
| 397 |
+
const visor = new THREE.Mesh(new THREE.BoxGeometry(0.3, 0.1, 0.35), new THREE.MeshBasicMaterial({ color: type === 'insan' ? 0x00ff88 : 0xff0055 }));
|
| 398 |
+
visor.position.set(0, 0.05, -0.2);
|
| 399 |
+
head.add(visor);
|
| 400 |
+
group.add(head);
|
| 401 |
+
|
| 402 |
+
// Kollar ve Bacaklar (Manken kolları gibi silindirik)
|
| 403 |
+
const armL = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.1, 1.0, 8), mat);
|
| 404 |
+
armL.position.set(-0.7, 1.6, 0);
|
| 405 |
+
group.add(armL);
|
| 406 |
+
|
| 407 |
+
const armR = new THREE.Mesh(new THREE.CylinderGeometry(0.12, 0.1, 1.0, 8), mat);
|
| 408 |
+
armR.position.set(0.7, 1.6, 0);
|
| 409 |
+
group.add(armR);
|
| 410 |
+
|
| 411 |
+
const legL = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.1, 1.2, 8), mat);
|
| 412 |
+
legL.position.set(-0.3, 0.6, 0);
|
| 413 |
+
group.add(legL);
|
| 414 |
+
|
| 415 |
+
const legR = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.1, 1.2, 8), mat);
|
| 416 |
+
legR.position.set(0.3, 0.6, 0);
|
| 417 |
+
group.add(legR);
|
| 418 |
+
|
| 419 |
+
group.scale.set(sizeScale, sizeScale, sizeScale);
|
| 420 |
+
group.position.set(x, y, z);
|
| 421 |
+
scene.add(group);
|
| 422 |
+
|
| 423 |
+
// HOLOGRAFİK BAŞ ÜSTÜ TABELASI (Canvas Tabanlı 3D Billboard)
|
| 424 |
+
const canvas = document.createElement('canvas');
|
| 425 |
+
canvas.width = 300;
|
| 426 |
+
canvas.height = 70;
|
| 427 |
+
const ctx = canvas.getContext('2d');
|
| 428 |
+
ctx.fillStyle = 'rgba(0, 0, 0, 0.8)';
|
| 429 |
+
ctx.fillRect(0, 0, 300, 70);
|
| 430 |
+
ctx.strokeStyle = type === 'insan' ? '#00ff88' : '#ff0055';
|
| 431 |
+
ctx.lineWidth = 4;
|
| 432 |
+
ctx.strokeRect(0, 0, 300, 70);
|
| 433 |
+
|
| 434 |
+
ctx.fillStyle = '#ffffff';
|
| 435 |
+
ctx.font = 'bold 20px Courier New';
|
| 436 |
+
ctx.textAlign = 'center';
|
| 437 |
+
ctx.fillText(nameLabel, 150, 42);
|
| 438 |
+
|
| 439 |
+
const textTex = new THREE.CanvasTexture(canvas);
|
| 440 |
+
const labelGeo = new THREE.PlaneGeometry(3.5, 0.8);
|
| 441 |
+
const labelMat = new THREE.MeshBasicMaterial({ map: textTex, transparent: true, side: THREE.DoubleSide });
|
| 442 |
+
const labelMesh = new THREE.Mesh(labelGeo, labelMat);
|
| 443 |
+
labelMesh.position.y = 3.3 * sizeScale; // Kafanın hemen üzerinde dursun
|
| 444 |
+
group.add(labelMesh);
|
| 445 |
+
|
| 446 |
+
enemies.push({
|
| 447 |
+
mesh: group,
|
| 448 |
+
label: labelMesh,
|
| 449 |
+
type: type,
|
| 450 |
+
hp: hp,
|
| 451 |
+
maxHp: hp,
|
| 452 |
+
height: 3 * sizeScale,
|
| 453 |
+
vx: (Math.random() - 0.5) * 0.15,
|
| 454 |
+
vz: (Math.random() - 0.5) * 0.15,
|
| 455 |
+
lastShot: 0,
|
| 456 |
+
shootCooldown: type === 'desert_boss' ? 800 : (type === 'haydut' ? 2200 : 1800)
|
| 457 |
+
});
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
function consumeBlood() {
|
| 461 |
+
if (player.blood > 0 && player.hp < player.maxHp) {
|
| 462 |
+
const needed = player.maxHp - player.hp;
|
| 463 |
+
const toUse = Math.min(needed, player.blood);
|
| 464 |
+
player.hp += toUse;
|
| 465 |
+
player.blood -= toUse;
|
| 466 |
+
updateHUD();
|
| 467 |
+
}
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
function reloadWeapon() {
|
| 471 |
+
const w = player.weapon;
|
| 472 |
+
player.ammo[w] = player.ammo[w + 'Max'];
|
| 473 |
+
updateHUD();
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
let recoilTime = 0;
|
| 477 |
+
function fireWeapon() {
|
| 478 |
+
const w = player.weapon;
|
| 479 |
+
if (player.ammo[w] <= 0) return;
|
| 480 |
+
player.ammo[w]--;
|
| 481 |
+
updateHUD();
|
| 482 |
+
|
| 483 |
+
recoilTime = 10;
|
| 484 |
+
|
| 485 |
+
const raycaster = new THREE.Raycaster();
|
| 486 |
+
raycaster.setFromCamera(new THREE.Vector2(0, 0), camera);
|
| 487 |
+
const dir = raycaster.ray.direction.clone().normalize();
|
| 488 |
+
|
| 489 |
+
if (w === 'atom') {
|
| 490 |
+
createBullet(camera.position, dir, 30, 0x00ffcc, 0.2);
|
| 491 |
+
} else if (w === 'shotgun') {
|
| 492 |
+
for (let i = 0; i < 6; i++) {
|
| 493 |
+
const spreadDir = dir.clone().add(new THREE.Vector3(
|
| 494 |
+
(Math.random() - 0.5) * 0.15,
|
| 495 |
+
(Math.random() - 0.5) * 0.15,
|
| 496 |
+
(Math.random() - 0.5) * 0.15
|
| 497 |
+
)).normalize();
|
| 498 |
+
createBullet(camera.position, spreadDir, 25, 0xff0055, 0.15);
|
| 499 |
+
}
|
| 500 |
+
}
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
function createBullet(pos, dir, dmg, color, size) {
|
| 504 |
+
const geo = new THREE.SphereGeometry(size, 8, 8);
|
| 505 |
+
const mat = new THREE.MeshBasicMaterial({ color: color });
|
| 506 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 507 |
+
mesh.position.copy(pos).add(dir.clone().multiplyScalar(1.5));
|
| 508 |
+
scene.add(mesh);
|
| 509 |
+
|
| 510 |
+
bullets.push({ mesh: mesh, dir: dir, speed: 4.5, damage: dmg, life: 120 }); // Mermi menzilini dev harita için artırdık
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
function spawnEnemyBullet(pos, dir, dmg) {
|
| 514 |
+
const geo = new THREE.SphereGeometry(0.4, 8, 8);
|
| 515 |
+
const mat = new THREE.MeshBasicMaterial({ color: 0xff0033 });
|
| 516 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 517 |
+
mesh.position.copy(pos);
|
| 518 |
+
scene.add(mesh);
|
| 519 |
+
|
| 520 |
+
enemyBullets.push({ mesh: mesh, dir: dir, speed: 2.0, damage: dmg, life: 200 });
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
function throwDynamite(pos, dir) {
|
| 524 |
+
const geo = new THREE.CylinderGeometry(0.2, 0.2, 0.8);
|
| 525 |
+
const mat = new THREE.MeshBasicMaterial({ color: 0xff0000 });
|
| 526 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 527 |
+
mesh.position.copy(pos);
|
| 528 |
+
scene.add(mesh);
|
| 529 |
+
|
| 530 |
+
dynamites.push({
|
| 531 |
+
mesh: mesh,
|
| 532 |
+
vx: dir.x * 1.5,
|
| 533 |
+
vy: 0.6,
|
| 534 |
+
vz: dir.z * 1.5,
|
| 535 |
+
timer: 100
|
| 536 |
+
});
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
function spawnBlood(pos, count) {
|
| 540 |
+
for (let i = 0; i < count; i++) {
|
| 541 |
+
const geo = new THREE.SphereGeometry(0.2, 6, 6);
|
| 542 |
+
const mat = new THREE.MeshBasicMaterial({ color: 0xff0055 });
|
| 543 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 544 |
+
mesh.position.copy(pos);
|
| 545 |
+
scene.add(mesh);
|
| 546 |
+
|
| 547 |
+
bloodDrops.push({
|
| 548 |
+
mesh: mesh,
|
| 549 |
+
vx: (Math.random() - 0.5) * 0.5,
|
| 550 |
+
vy: Math.random() * 0.6 + 0.2,
|
| 551 |
+
vz: (Math.random() - 0.5) * 0.5
|
| 552 |
+
});
|
| 553 |
+
}
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
function spawnAmmoPickup(pos, isWeapon = false) {
|
| 557 |
+
const geo = new THREE.BoxGeometry(1.5, 1.0, 1.5);
|
| 558 |
+
const mat = new THREE.MeshStandardMaterial({ color: isWeapon ? 0xff0055 : 0x00ffcc });
|
| 559 |
+
const mesh = new THREE.Mesh(geo, mat);
|
| 560 |
+
mesh.position.copy(pos);
|
| 561 |
+
mesh.position.y += 1.0;
|
| 562 |
+
scene.add(mesh);
|
| 563 |
+
|
| 564 |
+
ammoPickups.push({ mesh: mesh, isWeapon: isWeapon });
|
| 565 |
+
}
|
| 566 |
+
|
| 567 |
+
let prevTime = performance.now();
|
| 568 |
+
let currentBiome = "ORMAN BİYOMU";
|
| 569 |
+
|
| 570 |
+
function animate() {
|
| 571 |
+
requestAnimationFrame(animate);
|
| 572 |
+
|
| 573 |
+
if (isLocked) {
|
| 574 |
+
const time = performance.now();
|
| 575 |
+
const delta = (time - prevTime) / 1000;
|
| 576 |
+
|
| 577 |
+
// --- 1. OYUNCU HAREKETİ VE FİZİĞİ ---
|
| 578 |
+
velocity.x -= velocity.x * 8.0 * delta;
|
| 579 |
+
velocity.z -= velocity.z * 8.0 * delta;
|
| 580 |
+
velocity.y -= GRAVITY * delta;
|
| 581 |
+
|
| 582 |
+
direction.z = Number(moveForward) - Number(moveBackward);
|
| 583 |
+
direction.x = Number(moveRight) - Number(moveLeft);
|
| 584 |
+
direction.normalize();
|
| 585 |
+
|
| 586 |
+
const camDirY = camera.rotation.y;
|
| 587 |
+
if (moveForward || moveBackward || moveLeft || moveRight) {
|
| 588 |
+
velocity.z -= (direction.z * Math.cos(camDirY) - direction.x * Math.sin(camDirY)) * 800.0 * delta; // Devasa harita için hızlanma artırıldı
|
| 589 |
+
velocity.x -= (direction.z * Math.sin(camDirY) + direction.x * Math.cos(camDirY)) * 800.0 * delta;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
camera.position.x += velocity.x * delta;
|
| 593 |
+
camera.position.z += velocity.z * delta;
|
| 594 |
+
camera.position.y += velocity.y * delta;
|
| 595 |
+
|
| 596 |
+
// --- GÜNCEL BİYOM TESPİTİ ---
|
| 597 |
+
let newBiome = "ORMAN BİYOMU";
|
| 598 |
+
if (camera.position.y < -30) {
|
| 599 |
+
newBiome = "KARANLIK MADEN MAĞARASI";
|
| 600 |
+
} else if (camera.position.z < 0) {
|
| 601 |
+
newBiome = "ÇÖL BİYOMU";
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
if (newBiome !== currentBiome) {
|
| 605 |
+
currentBiome = newBiome;
|
| 606 |
+
alertBox.innerText = `YENİ BÖLGE: ${currentBiome}`;
|
| 607 |
+
alertBox.style.display = 'block';
|
| 608 |
+
setTimeout(() => { alertBox.style.display = 'none'; }, 2000);
|
| 609 |
+
|
| 610 |
+
if (currentBiome === "ÇÖL BİYOMU") {
|
| 611 |
+
scene.fog.color.setHex(0x554411);
|
| 612 |
+
scene.background.setHex(0x2d1a04);
|
| 613 |
+
} else if (currentBiome === "KARANLIK MADEN MAĞARASI") {
|
| 614 |
+
scene.fog.color.setHex(0x100101);
|
| 615 |
+
scene.background.setHex(0x020000);
|
| 616 |
+
} else {
|
| 617 |
+
scene.fog.color.setHex(0x040306);
|
| 618 |
+
scene.background.setHex(0x020102);
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
// Zemin Çarpışmaları
|
| 623 |
+
let floorHeight = 1.5;
|
| 624 |
+
if (camera.position.y < -40) {
|
| 625 |
+
floorHeight = -98.5; // Mağara tabanı
|
| 626 |
+
}
|
| 627 |
+
|
| 628 |
+
if (camera.position.y < floorHeight) {
|
| 629 |
+
velocity.y = 0;
|
| 630 |
+
camera.position.y = floorHeight;
|
| 631 |
+
canJump = true;
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
// Parkur Bloklarının Üstüne Tırmanma Fiziği
|
| 635 |
+
parkours.forEach(p => {
|
| 636 |
+
const halfW = p.geometry.parameters.width / 2;
|
| 637 |
+
const halfH = p.geometry.parameters.height / 2;
|
| 638 |
+
const halfD = p.geometry.parameters.depth / 2;
|
| 639 |
+
|
| 640 |
+
if (Math.abs(camera.position.x - p.position.x) < halfW + 1.2 &&
|
| 641 |
+
Math.abs(camera.position.z - p.position.z) < halfD + 1.2) {
|
| 642 |
+
|
| 643 |
+
if (camera.position.y >= p.position.y + halfH &&
|
| 644 |
+
camera.position.y + velocity.y * delta <= p.position.y + halfH + 2.0) {
|
| 645 |
+
velocity.y = 0;
|
| 646 |
+
camera.position.y = p.position.y + halfH + 1.8;
|
| 647 |
+
canJump = true;
|
| 648 |
+
}
|
| 649 |
+
}
|
| 650 |
+
});
|
| 651 |
+
|
| 652 |
+
// --- 2. SİLAH RECOIL VE MODEL DEĞİŞİMİ ---
|
| 653 |
+
if (recoilTime > 0) {
|
| 654 |
+
gunGroup.position.z = -0.45 + (recoilTime * 0.02);
|
| 655 |
+
gunGroup.position.y = -0.25 + (recoilTime * 0.005);
|
| 656 |
+
recoilTime--;
|
| 657 |
+
} else {
|
| 658 |
+
gunGroup.position.set(0.3, -0.25, -0.5);
|
| 659 |
+
}
|
| 660 |
+
|
| 661 |
+
if (player.weapon === 'atom') {
|
| 662 |
+
atomGunMesh.visible = true;
|
| 663 |
+
shotgunMesh.visible = false;
|
| 664 |
+
} else {
|
| 665 |
+
atomGunMesh.visible = false;
|
| 666 |
+
shotgunMesh.visible = true;
|
| 667 |
+
}
|
| 668 |
+
|
| 669 |
+
// --- 3. DİNAMİT FİZİĞİ & ALAN HASARI ---
|
| 670 |
+
for (let i = dynamites.length - 1; i >= 0; i--) {
|
| 671 |
+
const d = dynamites[i];
|
| 672 |
+
d.vy -= GRAVITY * 0.05 * delta;
|
| 673 |
+
d.mesh.position.x += d.vx;
|
| 674 |
+
d.mesh.position.y += d.vy;
|
| 675 |
+
d.mesh.position.z += d.vz;
|
| 676 |
+
d.timer--;
|
| 677 |
+
|
| 678 |
+
if (d.timer % 8 < 4) {
|
| 679 |
+
d.mesh.material.color.setHex(0xffff00);
|
| 680 |
+
} else {
|
| 681 |
+
d.mesh.material.color.setHex(0xff0000);
|
| 682 |
+
}
|
| 683 |
+
|
| 684 |
+
if (d.timer <= 0) {
|
| 685 |
+
const boomGeo = new THREE.SphereGeometry(8, 16, 16); // Devasa patlama alanı
|
| 686 |
+
const boomMat = new THREE.MeshBasicMaterial({ color: 0xff3300, transparent: true, opacity: 0.8 });
|
| 687 |
+
const boom = new THREE.Mesh(boomGeo, boomMat);
|
| 688 |
+
boom.position.copy(d.mesh.position);
|
| 689 |
+
scene.add(boom);
|
| 690 |
+
|
| 691 |
+
setTimeout(() => scene.remove(boom), 250);
|
| 692 |
+
|
| 693 |
+
const distToPlayer = d.mesh.position.distanceTo(camera.position);
|
| 694 |
+
if (distToPlayer < 15) {
|
| 695 |
+
player.hp -= (15 - distToPlayer) * 8;
|
| 696 |
+
updateHUD();
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
scene.remove(d.mesh);
|
| 700 |
+
dynamites.splice(i, 1);
|
| 701 |
+
}
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
// --- 4. OYUNCU MERMİLERİNİN DÜŞMAN KUKLALARA ÇARPMASI ---
|
| 705 |
+
for (let i = bullets.length - 1; i >= 0; i--) {
|
| 706 |
+
const b = bullets[i];
|
| 707 |
+
b.mesh.position.add(b.dir.clone().multiplyScalar(b.speed));
|
| 708 |
+
b.life--;
|
| 709 |
+
|
| 710 |
+
let hit = false;
|
| 711 |
+
for (let j = enemies.length - 1; j >= 0; j--) {
|
| 712 |
+
const e = enemies[j];
|
| 713 |
+
const dist = b.mesh.position.distanceTo(e.mesh.position);
|
| 714 |
+
|
| 715 |
+
let hitRadius = 2.0;
|
| 716 |
+
if (e.type === 'desert_boss') hitRadius = 8.0;
|
| 717 |
+
if (e.type === 'cave_boss') hitRadius = 10.0;
|
| 718 |
+
|
| 719 |
+
if (dist < hitRadius) {
|
| 720 |
+
e.hp -= b.damage;
|
| 721 |
+
hit = true;
|
| 722 |
+
|
| 723 |
+
// Hasar aldığında tabelayı sallayalım!
|
| 724 |
+
e.label.position.x = (Math.random() - 0.5) * 0.5;
|
| 725 |
+
|
| 726 |
+
if (e.hp <= 0) {
|
| 727 |
+
let bloodAmt = e.type === 'glock' ? 12 : (e.type === 'desert_boss' ? 150 : (e.type === 'cave_boss' ? 200 : (e.type === 'insan' ? 5 : 8)));
|
| 728 |
+
spawnBlood(e.mesh.position, bloodAmt);
|
| 729 |
+
|
| 730 |
+
if (e.type !== 'insan' && Math.random() < 0.35) {
|
| 731 |
+
spawnAmmoPickup(e.mesh.position, true); // Pompalı açıldı
|
| 732 |
+
} else {
|
| 733 |
+
spawnAmmoPickup(e.mesh.position, false);
|
| 734 |
+
}
|
| 735 |
+
|
| 736 |
+
scene.remove(e.mesh);
|
| 737 |
+
enemies.splice(j, 1);
|
| 738 |
+
|
| 739 |
+
if (e.type !== 'desert_boss' && e.type !== 'cave_boss') {
|
| 740 |
+
spawnPuppet(e.type, (Math.random() - 0.5) * 3000, 1, (Math.random() - 0.5) * 3000);
|
| 741 |
+
}
|
| 742 |
+
}
|
| 743 |
+
break;
|
| 744 |
+
}
|
| 745 |
+
}
|
| 746 |
+
|
| 747 |
+
if (hit || b.life <= 0) {
|
| 748 |
+
scene.remove(b.mesh);
|
| 749 |
+
bullets.splice(i, 1);
|
| 750 |
+
}
|
| 751 |
+
}
|
| 752 |
+
|
| 753 |
+
// --- 5. YAPAY ZEKA VE DÜŞMAN SİLAHLARI ---
|
| 754 |
+
enemies.forEach(e => {
|
| 755 |
+
const distToPlayer = e.mesh.position.distanceTo(camera.position);
|
| 756 |
+
const toPlayer = camera.position.clone().sub(e.mesh.position).normalize();
|
| 757 |
+
|
| 758 |
+
// Tabelanın oyuncuya dönmesini sağla (Billboard)
|
| 759 |
+
e.label.lookAt(camera.position);
|
| 760 |
+
|
| 761 |
+
if (e.type === 'sopali') {
|
| 762 |
+
e.mesh.position.x += toPlayer.x * 0.2;
|
| 763 |
+
e.mesh.position.z += toPlayer.z * 0.2;
|
| 764 |
+
|
| 765 |
+
if (distToPlayer < 3.0) {
|
| 766 |
+
player.hp -= 1.5;
|
| 767 |
+
updateHUD();
|
| 768 |
+
}
|
| 769 |
+
} else if (e.type === 'glock') {
|
| 770 |
+
if (distToPlayer > 35) {
|
| 771 |
+
e.mesh.position.x += toPlayer.x * 0.15;
|
| 772 |
+
e.mesh.position.z += toPlayer.z * 0.15;
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
+
const now = Date.now();
|
| 776 |
+
if (now - e.lastShot > e.shootCooldown && distToPlayer < 120) {
|
| 777 |
+
spawnEnemyBullet(e.mesh.position, toPlayer, 25);
|
| 778 |
+
e.lastShot = now;
|
| 779 |
+
}
|
| 780 |
+
} else if (e.type === 'haydut') {
|
| 781 |
+
if (distToPlayer > 45) {
|
| 782 |
+
e.mesh.position.x += toPlayer.x * 0.15;
|
| 783 |
+
e.mesh.position.z += toPlayer.z * 0.15;
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
const now = Date.now();
|
| 787 |
+
if (now - e.lastShot > e.shootCooldown && distToPlayer < 100) {
|
| 788 |
+
throwDynamite(e.mesh.position, toPlayer);
|
| 789 |
+
e.lastShot = now;
|
| 790 |
+
}
|
| 791 |
+
} else if (e.type === 'desert_boss') {
|
| 792 |
+
e.mesh.position.x += toPlayer.x * 0.18;
|
| 793 |
+
e.mesh.position.z += toPlayer.z * 0.18;
|
| 794 |
+
|
| 795 |
+
const now = Date.now();
|
| 796 |
+
if (now - e.lastShot > e.shootCooldown && distToPlayer < 250) {
|
| 797 |
+
spawnEnemyBullet(e.mesh.position, toPlayer, 35);
|
| 798 |
+
e.lastShot = now;
|
| 799 |
+
}
|
| 800 |
+
} else if (e.type === 'cave_boss') {
|
| 801 |
+
e.mesh.position.x += toPlayer.x * 0.08;
|
| 802 |
+
e.mesh.position.z += toPlayer.z * 0.08;
|
| 803 |
+
|
| 804 |
+
if (distToPlayer < 12.0) {
|
| 805 |
+
player.hp -= 10.0;
|
| 806 |
+
updateHUD();
|
| 807 |
+
}
|
| 808 |
+
} else if (e.type === 'insan') {
|
| 809 |
+
e.mesh.position.x += e.vx;
|
| 810 |
+
e.mesh.position.z += e.vz;
|
| 811 |
+
if (Math.random() < 0.01) {
|
| 812 |
+
e.vx = (Math.random() - 0.5) * 0.15;
|
| 813 |
+
e.vz = (Math.random() - 0.5) * 0.15;
|
| 814 |
+
}
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
// Yönlerini oyuncuya döndür
|
| 818 |
+
e.mesh.lookAt(camera.position.x, e.mesh.position.y, camera.position.z);
|
| 819 |
+
});
|
| 820 |
+
|
| 821 |
+
// --- 6. DÜŞMAN MERMİ TAKİBİ ---
|
| 822 |
+
for (let i = enemyBullets.length - 1; i >= 0; i--) {
|
| 823 |
+
const eb = enemyBullets[i];
|
| 824 |
+
eb.mesh.position.add(eb.dir.clone().multiplyScalar(eb.speed));
|
| 825 |
+
eb.life--;
|
| 826 |
+
|
| 827 |
+
const distToPlayer = eb.mesh.position.distanceTo(camera.position);
|
| 828 |
+
if (distToPlayer < 2.5) {
|
| 829 |
+
player.hp -= eb.damage;
|
| 830 |
+
updateHUD();
|
| 831 |
+
scene.remove(eb.mesh);
|
| 832 |
+
enemyBullets.splice(i, 1);
|
| 833 |
+
continue;
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
if (eb.life <= 0) {
|
| 837 |
+
scene.remove(eb.mesh);
|
| 838 |
+
enemyBullets.splice(i, 1);
|
| 839 |
+
}
|
| 840 |
+
}
|
| 841 |
+
|
| 842 |
+
// --- 7. KAN DAMLALARI TOPLAMA ---
|
| 843 |
+
for (let i = bloodDrops.length - 1; i >= 0; i--) {
|
| 844 |
+
const b = bloodDrops[i];
|
| 845 |
+
b.vy -= GRAVITY * 0.05 * delta;
|
| 846 |
+
b.mesh.position.x += b.vx;
|
| 847 |
+
b.mesh.position.y += b.vy;
|
| 848 |
+
b.mesh.position.z += b.vz;
|
| 849 |
+
|
| 850 |
+
let floorLimit = 0.5;
|
| 851 |
+
if (b.mesh.position.y < -40) floorLimit = -98.0;
|
| 852 |
+
|
| 853 |
+
if (b.mesh.position.y < floorLimit) {
|
| 854 |
+
b.mesh.position.y = floorLimit + 0.1;
|
| 855 |
+
b.vx = b.vy = b.vz = 0;
|
| 856 |
+
}
|
| 857 |
+
|
| 858 |
+
const distToPlayer = b.mesh.position.distanceTo(camera.position);
|
| 859 |
+
if (distToPlayer < 4.0) {
|
| 860 |
+
player.blood += 5;
|
| 861 |
+
updateHUD();
|
| 862 |
+
scene.remove(b.mesh);
|
| 863 |
+
bloodDrops.splice(i, 1);
|
| 864 |
+
}
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
// --- 8. MERMİ KUTUSU ALMA ---
|
| 868 |
+
for (let i = ammoPickups.length - 1; i >= 0; i--) {
|
| 869 |
+
const a = ammoPickups[i];
|
| 870 |
+
a.mesh.rotation.y += 0.02;
|
| 871 |
+
|
| 872 |
+
const distToPlayer = a.mesh.position.distanceTo(camera.position);
|
| 873 |
+
if (distToPlayer < 4.0) {
|
| 874 |
+
if (a.isWeapon) {
|
| 875 |
+
player.weapon = 'shotgun';
|
| 876 |
+
player.ammo.shotgun = player.ammo.shotgunMax;
|
| 877 |
+
} else {
|
| 878 |
+
player.ammo.atom = player.ammo.atomMax;
|
| 879 |
+
player.ammo.shotgun = Math.min(player.ammo.shotgunMax, player.ammo.shotgun + 3);
|
| 880 |
+
}
|
| 881 |
+
updateHUD();
|
| 882 |
+
scene.remove(a.mesh);
|
| 883 |
+
ammoPickups.splice(i, 1);
|
| 884 |
+
}
|
| 885 |
+
}
|
| 886 |
+
|
| 887 |
+
// --- 9. YENİDEN DOĞMA ---
|
| 888 |
+
if (player.hp <= 0) {
|
| 889 |
+
alert("KUKLALAR SENİ ETKİSİZ HALE GETİRDİ! Yeniden başlanıyor...");
|
| 890 |
+
player.hp = 250;
|
| 891 |
+
player.blood = 0;
|
| 892 |
+
player.weapon = 'atom';
|
| 893 |
+
player.ammo.atom = player.ammo.atomMax;
|
| 894 |
+
updateHUD();
|
| 895 |
+
|
| 896 |
+
enemies.forEach(e => scene.remove(e.mesh));
|
| 897 |
+
bullets.forEach(b => scene.remove(b.mesh));
|
| 898 |
+
enemyBullets.forEach(eb => scene.remove(eb.mesh));
|
| 899 |
+
bloodDrops.forEach(bd => scene.remove(bd.mesh));
|
| 900 |
+
ammoPickups.forEach(ap => scene.remove(ap.mesh));
|
| 901 |
+
dynamites.forEach(d => scene.remove(d.mesh));
|
| 902 |
+
|
| 903 |
+
enemies = []; bullets = []; enemyBullets = []; bloodDrops = []; ammoPickups = []; dynamites = [];
|
| 904 |
+
|
| 905 |
+
for (let i = 0; i < 15; i++) spawnPuppet('sopali', (Math.random() - 0.5) * 2000, 1, Math.random() * 2000 + 200);
|
| 906 |
+
for (let i = 0; i < 12; i++) spawnPuppet('glock', (Math.random() - 0.5) * 2000, 1, Math.random() * 2000 + 200);
|
| 907 |
+
for (let i = 0; i < 15; i++) spawnPuppet('insan', (Math.random() - 0.5) * 3000, 1, (Math.random() - 0.5) * 3000);
|
| 908 |
+
for (let i = 0; i < 15; i++) spawnPuppet('haydut', (Math.random() - 0.5) * 2000, 1, -Math.random() * 2000 - 200);
|
| 909 |
+
spawnPuppet('desert_boss', 0, 4, -1000);
|
| 910 |
+
spawnPuppet('cave_boss', 0, -96, 0);
|
| 911 |
+
|
| 912 |
+
camera.position.set(0, 5, 200);
|
| 913 |
+
}
|
| 914 |
+
|
| 915 |
+
prevTime = time;
|
| 916 |
+
}
|
| 917 |
+
|
| 918 |
+
renderer.render(scene, camera);
|
| 919 |
+
}
|
| 920 |
+
|
| 921 |
+
function updateHUD() {
|
| 922 |
+
document.getElementById('hp').innerText = Math.max(0, Math.floor(player.hp));
|
| 923 |
+
document.getElementById('blood').innerText = player.blood;
|
| 924 |
+
document.getElementById('weapon').innerText = player.weapon === 'atom' ? 'Atom Tabancası' : 'Pompalı Tüfek';
|
| 925 |
+
document.getElementById('weapon').style.color = player.weapon === 'atom' ? '#00ffcc' : '#ff0055';
|
| 926 |
+
document.getElementById('ammo').innerText = `${player.ammo[player.weapon]}/${player.ammo[player.weapon + 'Max']}`;
|
| 927 |
+
}
|
| 928 |
+
|
| 929 |
+
function onWindowResize() {
|
| 930 |
+
camera.aspect = window.innerWidth / window.innerHeight;
|
| 931 |
+
camera.updateProjectionMatrix();
|
| 932 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 933 |
+
}
|
| 934 |
+
</script>
|
| 935 |
+
</body>
|
| 936 |
</html>
|
| 937 |
+
"""
|
| 938 |
+
|
| 939 |
+
with tempfile.NamedTemporaryFile('w', delete=False, suffix='.html', encoding='utf-8') as f:
|
| 940 |
+
f.write(html_content)
|
| 941 |
+
temp_path = f.name
|
| 942 |
+
|
| 943 |
+
webbrowser.open('file://' + os.path.realpath(temp_path))
|