File size: 24,159 Bytes
8d8dab5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mortal Kombat Replica</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Metal+Mania&display=swap');
.mk-font {
font-family: 'Metal Mania', cursive;
}
.blood-drip {
position: relative;
}
.blood-drip::after {
content: '';
position: absolute;
bottom: -10px;
left: 0;
width: 100%;
height: 15px;
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0,10 C20,25 30,5 50,10 C70,15 80,0 100,10 L100,20 L0,20 Z" fill="%23d10000"/></svg>') repeat-x;
background-size: 100px 15px;
}
.character-select {
transition: all 0.3s ease;
}
.character-select:hover {
transform: scale(1.05);
filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.7));
}
.selected-character {
transform: scale(1.1);
filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.9));
}
.health-bar {
height: 30px;
transition: width 0.3s ease;
}
.fatality-effect {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, rgba(255,0,0,0.8) 0%, rgba(0,0,0,0.9) 70%);
z-index: 100;
display: none;
justify-content: center;
align-items: center;
animation: pulse 0.5s infinite alternate;
}
@keyframes pulse {
from { opacity: 0.8; }
to { opacity: 1; }
}
.combo-display {
position: absolute;
font-size: 2rem;
color: #ffcc00;
text-shadow: 0 0 10px #ff0000;
opacity: 0;
transition: all 0.3s ease;
}
</style>
</head>
<body class="bg-gray-900 text-white">
<div class="fatality-effect" id="fatalityEffect">
<h1 class="text-6xl mk-font text-red-600">FATALITY!</h1>
</div>
<div class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="text-center mb-12">
<h1 class="text-6xl md:text-8xl mk-font blood-drip text-red-600 mb-4">MORTAL KOMBAT</h1>
<p class="text-xl text-yellow-400">CHOOSE YOUR DESTINY</p>
</header>
<!-- Character Selection -->
<div class="grid grid-cols-2 md:grid-cols-4 gap-6 mb-12" id="characterSelection">
<div class="character-select cursor-pointer text-center" data-character="scorpion">
<div class="bg-gray-800 rounded-lg overflow-hidden border-2 border-red-700 p-4">
<img src="https://i.imgur.com/JjQY9zX.png" alt="Scorpion" class="w-full h-48 object-contain">
<h3 class="text-xl mt-2 text-red-500 mk-font">SCORPION</h3>
</div>
</div>
<div class="character-select cursor-pointer text-center" data-character="subzero">
<div class="bg-gray-800 rounded-lg overflow-hidden border-2 border-blue-700 p-4">
<img src="https://i.imgur.com/5vQz6Wq.png" alt="Sub-Zero" class="w-full h-48 object-contain">
<h3 class="text-xl mt-2 text-blue-400 mk-font">SUB-ZERO</h3>
</div>
</div>
<div class="character-select cursor-pointer text-center" data-character="liukang">
<div class="bg-gray-800 rounded-lg overflow-hidden border-2 border-yellow-600 p-4">
<img src="https://i.imgur.com/8mZ9vWg.png" alt="Liu Kang" class="w-full h-48 object-contain">
<h3 class="text-xl mt-2 text-yellow-400 mk-font">LIU KANG</h3>
</div>
</div>
<div class="character-select cursor-pointer text-center" data-character="raiden">
<div class="bg-gray-800 rounded-lg overflow-hidden border-2 border-blue-400 p-4">
<img src="https://i.imgur.com/3XQ3v9W.png" alt="Raiden" class="w-full h-48 object-contain">
<h3 class="text-xl mt-2 text-blue-300 mk-font">RAIDEN</h3>
</div>
</div>
</div>
<!-- Fight Area -->
<div class="bg-gray-800 rounded-lg border-4 border-red-900 p-6 mb-8 hidden" id="fightArea">
<div class="flex justify-between items-center mb-6">
<div class="w-1/3">
<div class="flex items-center">
<img src="https://i.imgur.com/JjQY9zX.png" alt="Player 1" class="w-16 h-16 rounded-full border-2 border-red-600 mr-4" id="player1Avatar">
<div>
<h3 class="text-xl text-red-500 mk-font" id="player1Name">PLAYER 1</h3>
<div class="health-bar bg-red-600 rounded-full" id="player1Health" style="width: 100%"></div>
</div>
</div>
</div>
<div class="text-4xl mk-font text-yellow-400">VS</div>
<div class="w-1/3">
<div class="flex items-center justify-end">
<div class="text-right mr-4">
<h3 class="text-xl text-blue-400 mk-font" id="player2Name">PLAYER 2</h3>
<div class="health-bar bg-blue-600 rounded-full" id="player2Health" style="width: 100%"></div>
</div>
<img src="https://i.imgur.com/5vQz6Wq.png" alt="Player 2" class="w-16 h-16 rounded-full border-2 border-blue-600" id="player2Avatar">
</div>
</div>
</div>
<div class="bg-gray-700 rounded-lg p-6 relative h-64 overflow-hidden" id="arena">
<div class="absolute inset-0 bg-gradient-to-r from-gray-800 to-gray-900 opacity-50"></div>
<div class="relative z-10 flex justify-center items-center h-full">
<div class="text-center">
<p class="text-xl mb-4">Press any key to attack!</p>
<div class="flex justify-center space-x-4">
<button class="bg-red-600 hover:bg-red-700 text-white px-6 py-2 rounded-lg mk-font" id="punchButton">PUNCH</button>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg mk-font" id="kickButton">KICK</button>
<button class="bg-yellow-600 hover:bg-yellow-700 text-black px-6 py-2 rounded-lg mk-font" id="specialButton">SPECIAL</button>
</div>
</div>
</div>
<div class="absolute top-0 left-0 w-full h-full flex justify-center items-center pointer-events-none">
<div class="combo-display" id="comboDisplay"></div>
</div>
</div>
<div class="mt-6 flex justify-between">
<div class="text-red-400">
<p>Player 1 Health: <span id="player1HealthValue">100</span>%</p>
</div>
<div class="text-blue-400">
<p>Player 2 Health: <span id="player2HealthValue">100</span>%</p>
</div>
</div>
</div>
<!-- Controls -->
<div class="bg-gray-800 rounded-lg border-2 border-gray-700 p-6 mt-8">
<h2 class="text-2xl mk-font text-yellow-400 mb-4">CONTROLS</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="bg-gray-700 p-4 rounded-lg">
<h3 class="text-lg text-red-400 mb-2">Basic Attacks</h3>
<ul class="space-y-2">
<li><span class="text-yellow-400">Punch:</span> Quick jab (5 damage)</li>
<li><span class="text-yellow-400">Kick:</span> Strong kick (10 damage)</li>
</ul>
</div>
<div class="bg-gray-700 p-4 rounded-lg">
<h3 class="text-lg text-red-400 mb-2">Special Moves</h3>
<ul class="space-y-2">
<li><span class="text-yellow-400">Special:</span> Character-specific (15-25 damage)</li>
<li><span class="text-yellow-400">Combo:</span> Chain attacks for bonus damage</li>
</ul>
</div>
<div class="bg-gray-700 p-4 rounded-lg">
<h3 class="text-lg text-red-400 mb-2">Fatality</h3>
<ul class="space-y-2">
<li>Reduce opponent health to 0</li>
<li>Press <span class="text-yellow-400">F</span> for Fatality!</li>
</ul>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Game state
const gameState = {
player1: {
name: '',
health: 100,
character: null,
avatar: '',
specialMove: ''
},
player2: {
name: 'COMPUTER',
health: 100,
character: null,
avatar: '',
specialMove: ''
},
currentPlayer: 1,
comboCount: 0,
lastAttackTime: 0,
gameActive: false
};
// Character data
const characters = {
scorpion: {
name: 'SCORPION',
avatar: 'https://i.imgur.com/JjQY9zX.png',
specialMove: 'SPEAR THROW',
specialDamage: 25,
color: 'red'
},
subzero: {
name: 'SUB-ZERO',
avatar: 'https://i.imgur.com/5vQz6Wq.png',
specialMove: 'ICE BLAST',
specialDamage: 20,
color: 'blue'
},
liukang: {
name: 'LIU KANG',
avatar: 'https://i.imgur.com/8mZ9vWg.png',
specialMove: 'FLYING KICK',
specialDamage: 22,
color: 'yellow'
},
raiden: {
name: 'RAIDEN',
avatar: 'https://i.imgur.com/3XQ3v9W.png',
specialMove: 'LIGHTNING STRIKE',
specialDamage: 18,
color: 'blue'
}
};
// DOM elements
const characterSelection = document.getElementById('characterSelection');
const fightArea = document.getElementById('fightArea');
const player1Name = document.getElementById('player1Name');
const player1Avatar = document.getElementById('player1Avatar');
const player1Health = document.getElementById('player1Health');
const player1HealthValue = document.getElementById('player1HealthValue');
const player2Name = document.getElementById('player2Name');
const player2Avatar = document.getElementById('player2Avatar');
const player2Health = document.getElementById('player2Health');
const player2HealthValue = document.getElementById('player2HealthValue');
const punchButton = document.getElementById('punchButton');
const kickButton = document.getElementById('kickButton');
const specialButton = document.getElementById('specialButton');
const arena = document.getElementById('arena');
const fatalityEffect = document.getElementById('fatalityEffect');
const comboDisplay = document.getElementById('comboDisplay');
// Character selection
const characterSelects = document.querySelectorAll('.character-select');
characterSelects.forEach(select => {
select.addEventListener('click', function() {
const character = this.getAttribute('data-character');
// Reset all selections
characterSelects.forEach(s => {
s.querySelector('div').classList.remove('selected-character', 'border-red-600', 'border-blue-600', 'border-yellow-600', 'border-blue-400');
});
// Set selected character
this.querySelector('div').classList.add('selected-character');
// Set player 1 character
gameState.player1.character = character;
gameState.player1.name = characters[character].name;
gameState.player1.avatar = characters[character].avatar;
gameState.player1.specialMove = characters[character].specialMove;
// Randomly select computer character
const computerCharacters = Object.keys(characters).filter(c => c !== character);
const randomCharacter = computerCharacters[Math.floor(Math.random() * computerCharacters.length)];
gameState.player2.character = randomCharacter;
gameState.player2.name = characters[randomCharacter].name;
gameState.player2.avatar = characters[randomCharacter].avatar;
gameState.player2.specialMove = characters[randomCharacter].specialMove;
// Update UI
player1Name.textContent = gameState.player1.name;
player1Avatar.src = gameState.player1.avatar;
player2Name.textContent = gameState.player2.name;
player2Avatar.src = gameState.player2.avatar;
// Show fight area
fightArea.classList.remove('hidden');
gameState.gameActive = true;
// Scroll to fight area
fightArea.scrollIntoView({ behavior: 'smooth' });
});
});
// Attack functions
function punch() {
if (!gameState.gameActive) return;
const damage = 5 + Math.floor(Math.random() * 3);
attack(damage, 'PUNCH');
}
function kick() {
if (!gameState.gameActive) return;
const damage = 8 + Math.floor(Math.random() * 5);
attack(damage, 'KICK');
}
function special() {
if (!gameState.gameActive) return;
const character = gameState.player1.character;
const damage = characters[character].specialDamage;
attack(damage, gameState.player1.specialMove);
}
function attack(damage, move) {
// Check for combo
const now = Date.now();
if (now - gameState.lastAttackTime < 1000) {
gameState.comboCount++;
showCombo(gameState.comboCount);
// Bonus damage for combos
damage += Math.floor(gameState.comboCount * 1.5);
} else {
gameState.comboCount = 0;
}
gameState.lastAttackTime = now;
// Apply damage to opponent
gameState.player2.health = Math.max(0, gameState.player2.health - damage);
// Update UI
updateHealthBars();
// Show attack effect
showAttackEffect(move, damage);
// Check for fatality
if (gameState.player2.health <= 0) {
fatality();
return;
}
// Computer counter attack
setTimeout(computerAttack, 800);
}
function computerAttack() {
if (!gameState.gameActive || gameState.player2.health <= 0) return;
const attacks = ['punch', 'kick', 'special'];
const randomAttack = attacks[Math.floor(Math.random() * attacks.length)];
let damage = 0;
let move = '';
switch(randomAttack) {
case 'punch':
damage = 4 + Math.floor(Math.random() * 3);
move = 'PUNCH';
break;
case 'kick':
damage = 7 + Math.floor(Math.random() * 4);
move = 'KICK';
break;
case 'special':
damage = characters[gameState.player2.character].specialDamage - 3 + Math.floor(Math.random() * 6);
move = gameState.player2.specialMove;
break;
}
// Apply damage to player
gameState.player1.health = Math.max(0, gameState.player1.health - damage);
// Update UI
updateHealthBars();
// Show attack effect
showAttackEffect(move, damage, true);
// Check for fatality
if (gameState.player1.health <= 0) {
fatality();
}
}
function updateHealthBars() {
player1Health.style.width = `${gameState.player1.health}%`;
player2Health.style.width = `${gameState.player2.health}%`;
player1HealthValue.textContent = gameState.player1.health;
player2HealthValue.textContent = gameState.player2.health;
// Change color based on health
if (gameState.player1.health < 30) {
player1Health.classList.remove('bg-red-600');
player1Health.classList.add('bg-red-800');
} else {
player1Health.classList.remove('bg-red-800');
player1Health.classList.add('bg-red-600');
}
if (gameState.player2.health < 30) {
player2Health.classList.remove('bg-blue-600');
player2Health.classList.add('bg-blue-800');
} else {
player2Health.classList.remove('bg-blue-800');
player2Health.classList.add('bg-blue-600');
}
}
function showAttackEffect(move, damage, isComputer = false) {
const effect = document.createElement('div');
effect.className = 'absolute text-xl font-bold';
if (isComputer) {
effect.className += ' text-blue-400 right-4 top-4';
effect.textContent = `${move} -${damage}`;
} else {
effect.className += ' text-red-500 left-4 top-4';
effect.textContent = `${move} -${damage}`;
}
arena.appendChild(effect);
// Animate
setTimeout(() => {
effect.style.opacity = '0';
effect.style.transform = isComputer ? 'translateX(20px)' : 'translateX(-20px)';
}, 100);
// Remove after animation
setTimeout(() => {
effect.remove();
}, 1000);
}
function showCombo(count) {
if (count < 2) return;
comboDisplay.textContent = `COMBO x${count}`;
comboDisplay.style.opacity = '1';
comboDisplay.style.transform = 'scale(1.5)';
setTimeout(() => {
comboDisplay.style.opacity = '0';
comboDisplay.style.transform = 'scale(1)';
}, 1000);
}
function fatality() {
gameState.gameActive = false;
fatalityEffect.style.display = 'flex';
// Play sound (would be added if we had audio)
// new Audio('fatality.mp3').play();
setTimeout(() => {
fatalityEffect.style.display = 'none';
// Reset game after fatality
setTimeout(resetGame, 2000);
}, 3000);
}
function resetGame() {
gameState.player1.health = 100;
gameState.player2.health = 100;
gameState.comboCount = 0;
gameState.lastAttackTime = 0;
updateHealthBars();
// Reset character selection
characterSelects.forEach(select => {
select.querySelector('div').classList.remove('selected-character');
});
fightArea.classList.add('hidden');
gameState.gameActive = false;
}
// Event listeners
punchButton.addEventListener('click', punch);
kickButton.addEventListener('click', kick);
specialButton.addEventListener('click', special);
// Keyboard controls
document.addEventListener('keydown', function(e) {
if (!gameState.gameActive) return;
switch(e.key.toLowerCase()) {
case 'p':
punch();
break;
case 'k':
kick();
break;
case 's':
special();
break;
case 'f':
if (gameState.player2.health <= 0) {
fatality();
}
break;
}
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=annyable/sus" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |