Sign up
Login
New
Trending
Archive
English
English
Sign up
Login
New Paste
Add Image
<!DOCTYPE html> <html lang="ar" dir="rtl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>هروب الكهف - لعبة مغامرات</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: white; min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 10px; } #gameContainer { max-width: 900px; width: 100%; } .screen { display: none; background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%); border-radius: 15px; padding: 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); } .screen.active { display: block; } h1 { color: #ffd700; text-align: center; font-size: 2.5em; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); } .subtitle { color: #ffb700; text-align: center; font-size: 0.9em; margin-bottom: 20px; } .description { text-align: center; color: #ccc; margin-bottom: 30px; } .btn { width: 100%; padding: 15px; margin: 10px 0; border: none; border-radius: 10px; font-size: 1.2em; font-weight: bold; cursor: pointer; transition: all 0.3s; color: white; } .btn-primary { background: linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%); } .btn-primary:hover { transform: scale(1.05); box-shadow: 0 5px 20px rgba(65, 105, 225, 0.5); } .btn-secondary { background: linear-gradient(135deg, #6b7280 0%, #374151 100%); } .btn-secondary:hover { transform: scale(1.05); } .btn-success { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); } .btn-danger { background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%); } .btn-warning { background: linear-gradient(135deg, #eab308 0%, #a16207 100%); } .settings-group { margin: 20px 0; } .settings-label { font-weight: bold; margin-bottom: 10px; display: block; color: #ffd700; } .settings-options { display: flex; gap: 10px; } .settings-options .btn { flex: 1; } #gameCanvas { width: 100%; border: 4px solid #ffd700; border-radius: 10px; background: #000; display: block; } .game-header { background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%); padding: 15px; border-radius: 10px 10px 0 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 4px solid #ffd700; } .stats { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; } .stat-item { display: flex; align-items: center; gap: 5px; font-weight: bold; } .hearts { display: flex; gap: 3px; } .heart { color: #ef4444; font-size: 1.2em; } .heart.empty { color: #4b5563; } .floor-info { font-size: 1.2em; font-weight: bold; } .controls { background: #2d2d44; padding: 15px; border-radius: 0 0 10px 10px; display: flex; justify-content: space-between; gap: 10px; border-top: 4px solid #ffd700; } .control-btn { background: #374151; border: none; color: white; padding: 15px 20px; border-radius: 10px; font-size: 1.5em; cursor: pointer; touch-action: manipulation; user-select: none; } .control-btn:active { background: #4169e1; transform: scale(0.95); } .control-btn.jump { background: #22c55e; } .control-btn.attack { background: #ef4444; } .modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); display: none; justify-content: center; align-items: center; z-index: 1000; } .modal.active { display: flex; } .modal-content { background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%); padding: 30px; border-radius: 15px; max-width: 500px; width: 90%; border: 4px solid #ffd700; } .message-box { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.95); color: #ffd700; padding: 20px 40px; border-radius: 10px; font-size: 1.2em; font-weight: bold; border: 2px solid #ffd700; display: none; z-index: 999; } .dialogue-box { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.95); color: white; padding: 20px; border-radius: 10px; max-width: 600px; width: 90%; border: 2px solid #ffd700; display: none; z-index: 999; } .dialogue-speaker { color: #ffd700; font-weight: bold; margin-bottom: 10px; } .quests { background: #2d2d44; padding: 10px; font-size: 0.9em; color: #ccc; } .quest-item { display: flex; justify-content: space-between; margin: 5px 0; } .quest-progress { color: #ffd700; } .quest-complete { color: #22c55e; font-weight: bold; } .controls-left { display: flex; gap: 10px; } @media (max-width: 600px) { h1 { font-size: 1.8em; } .btn { font-size: 1em; padding: 12px; } .control-btn { padding: 12px 15px; font-size: 1.2em; } } </style> </head> <body> <div id="gameContainer"> <!-- Main Menu --> <div id="menuScreen" class="screen active"> <h1>هروب الكهف</h1> <p class="subtitle">رحلة الطفل نحو الحرية</p> <p class="description">ساعد الطفل على الهروب من الكهوف المظلمة والروبوتات القاتلة</p> <button class="btn btn-primary" onclick="startGame()">⚔️ ابدأ اللعبة</button> <button class="btn btn-secondary" onclick="showSettings()">⚙️ الإعدادات</button> <div style="margin-top: 30px; background: #2d2d44; padding: 20px; border-radius: 10px; font-size: 0.9em;"> <p style="color: #ffd700; font-weight: bold; margin-bottom: 10px;">📱 التحكم:</p> <p style="margin: 5px 0;">🎮 الجوال: استخدم الأزرار على الشاشة</p> <p style="margin: 5px 0;">⌨️ الكمبيوتر: الأسهم/WASD للحركة • مسافة للقفز • X للهجوم</p> <p style="margin-top: 15px; color: #999; font-size: 0.85em;">🎯 10 طوابق • 5 بوسات أقوياء • مهام جانبية</p> <p style="color: #999; font-size: 0.85em;">💰 اجمع النقود وطور أسلحتك ودروعك</p> </div> </div> <!-- Settings Screen --> <div id="settingsScreen" class="screen"> <h1>⚙️ الإعدادات</h1> <div class="settings-group"> <label class="settings-label">🔊 الصوت</label> <div class="settings-options"> <button class="btn btn-success" onclick="setSetting('sound', true)">تشغيل</button> <button class="btn btn-danger" onclick="setSetting('sound', false)">إيقاف</button> </div> </div> <div class="settings-group"> <label class="settings-label">⚡ الصعوبة</label> <div class="settings-options"> <button class="btn btn-success" onclick="setSetting('difficulty', 'easy')">😊 سهل</button> <button class="btn btn-warning" onclick="setSetting('difficulty', 'normal')">😐 عادي</button> <button class="btn btn-danger" onclick="setSetting('difficulty', 'hard')">😈 صعب</button> </div> </div> <button class="btn btn-primary" onclick="backToMenu()">✓ حفظ والعودة</button> </div> <!-- Game Screen --> <div id="gameScreen" class="screen"> <div class="game-header"> <div class="stats"> <div class="hearts" id="hearts"></div> <div class="stat-item"> <span>💰</span> <span id="coins">0</span> </div> <div class="stat-item"> <span>🔑</span> <span id="keys">0</span> </div> <div class="stat-item" id="swordStat" style="display: none;"> <span>⚔️</span> <span id="swordLevel">0</span> </div> <div class="stat-item" id="armorStat" style="display: none;"> <span>🛡️</span> <span id="armorLevel">0</span> </div> </div> <div class="floor-info"> الطابق <span id="floor">1</span>/10 <span id="floorType"></span> </div> </div> <div id="questsContainer" class="quests" style="display: none;"></div> <canvas id="gameCanvas" width="800" height="500"></canvas> <div class="controls"> <div class="controls-left"> <button class="control-btn" id="leftBtn">◀</button> <button class="control-btn" id="rightBtn">▶</button> </div> <button class="control-btn jump" id="jumpBtn">⬆</button> <button class="control-btn attack" id="attackBtn">⚔️</button> </div> </div> <!-- Victory Screen --> <div id="victoryScreen" class="screen"> <h1>🎉 انتصار! 🎉</h1> <p class="description" style="font-size: 1.5em; margin: 20px 0;">نجحت في الهروب من الكهف!</p> <p class="description">هزمت جميع البوسات وأنقذت نفسك من الكهف المظلم</p> <div style="background: #2d2d44; padding: 20px; border-radius: 10px; margin: 20px 0;"> <p style="color: #ffd700; font-weight: bold; margin-bottom: 15px;">إحصائياتك:</p> <p style="margin: 5px 0;">💰 النقود المتبقية: <span id="finalCoins">0</span></p> <p style="margin: 5px 0;">⚔️ مستوى السيف: <span id="finalSword">0</span></p> <p style="margin: 5px 0;">🛡️ مستوى الدرع: <span id="finalArmor">0</span></p> <p style="margin: 5px 0;">✅ المهام المنجزة: <span id="finalQuests">0</span></p> </div> <button class="btn btn-primary" onclick="restartGame()">🔄 العب مرة أخرى</button> </div> </div> <!-- Modals --> <div id="shopModal" class="modal"> <div class="modal-content"> <h1 style="font-size: 2em;">🏪 التاجر السري</h1> <p style="text-align: center; margin: 15px 0;">لديك <span id="shopCoins">0</span> نقود</p> <button class="btn btn-secondary" onclick="buyItem('sword', 100)" style="display: flex; justify-content: space-between; align-items: center;"> <span>⚔️ سيف أقوى (مستوى <span id="nextSword">1</span>)</span> <span style="color: #ffd700;">100 💰</span> </button> <button class="btn btn-secondary" onclick="buyItem('armor', 150)" style="display: flex; justify-content: space-between; align-items: center;"> <span>🛡️ درع أقوى (مستوى <span id="nextArmor">1</span>)</span> <span style="color: #ffd700;">150 💰</span> </button> <button class="btn btn-secondary" onclick="buyHealthPotion()" style="display: flex; justify-content: space-between; align-items: center;"> <span>❤️ جرعة شفاء (+1 قلب)</span> <span style="color: #ffd700;">30 💰</span> </button> <button class="btn btn-primary" onclick="continueToNextFloor()">➡️ متابعة للطابق التالي</button> </div> </div> <div id="messageBox" class="message-box"></div> <div id="dialogueBox" class="dialogue-box"> <div class="dialogue-speaker" id="dialogueSpeaker"></div> <div id="dialogueText"></div> </div> <script> // Game State const game = { state: 'menu', floor: 1, floorType: 'normal', checkpointFloor: 1, player: { x: 100, y: 350, width: 30, height: 40, velocityY: 0, health: 3, maxHealth: 3, coins: 0, sword: 0, armor: 0, keys: 0, isJumping: false, facingRight: true, isAttacking: false, invincible: false, hasLamp: false }, enemies: [], boss: null, items: [], traps: [], doors: [], npcs: [], particles: [], sideQuests: [], completedQuests: [], bossDefeated: [], settings: { sound: true, difficulty: 'normal' }, controls: { left: false, right: false, jump: false, attack: false } }; const canvas = document.getElementById('gameCanvas'); const ctx = canvas.getContext('2d'); const GRAVITY = 0.6; const JUMP_FORCE = -12; const MOVE_SPEED = 5; const GROUND_Y = 400; const bossFloors = [3, 5, 8, 9, 10]; const bossDialogues = { 3: { intro: "أنا القائد الآلي! لن تهرب من هنا أيها الطفل الضعيف!", defeat: "مستحيل... كيف هزمني طفل صغير..." }, 5: { intro: "الجنرال السايبورغ هنا! سأسحقك تحت قدمي الحديدية!", defeat: "أنت... أقوى مما ظننت... لكن هذا ليس النهاية..." }, 8: { intro: "أنا المارشال الحديدي! حاكم هذه الطوابق! استسلم الآن!", defeat: "قوتك... مذهلة... لكن ملكنا سيوقفك..." }, 9: { intro: "الإمبراطور الميكانيكي! أنت شجاع لكن غبي! سأنهيك!", defeat: "ملك الظلام... انتظرك... في الأعلى..." }, 10: { intro: "أخيراً وصلت يا طفل! أنا ملك الظلام الآلي! هنا تنتهي رحلتك!", defeat: "لا... لا يمكن... البشر... أقوى من الآلات... اهرب... قبل انفجار الكهف..." } }; const merchantDialogues = [ "أهلاً يا بطل! لدي بضائع نادرة لك!", "عمل رائع في هزيمة البوس! تفضل تسوق معي", "أنت تتقدم بسرعة! خذ هذه العروض الخاصة", "قريب من النهاية! لا تنسى تحسين معداتك", "هذه آخر فرصة! اشتري كل ما تحتاج للمعركة الأخيرة!" ]; // Screen Management function showScreen(screenId) { document.querySelectorAll('.screen').forEach(s => s.classList.remove('active')); document.getElementById(screenId).classList.add('active'); } function startGame() { game.state = 'playing'; showScreen('gameScreen'); initializeFloor(); gameLoop(); } function showSettings() { showScreen('settingsScreen'); } function backToMenu() { showScreen('menuScreen'); } function restartGame() { game.floor = 1; game.checkpointFloor = 1; game.bossDefeated = []; game.completedQuests = []; game.player = { x: 100, y: 350, width: 30, height: 40, velocityY: 0, health: 3, maxHealth: 3, coins: 0, sword: 0, armor: 0, keys: 0, isJumping: false, facingRight: true, isAttacking: false, invincible: false, hasLamp: false }; showScreen('menuScreen'); } function setSetting(key, value) { game.settings[key] = value; } // Floor Initialization function initializeFloor() { const types = ['normal', 'dark', 'water', 'rocky']; const floorTypeIndex = Math.floor((game.floor - 1) / 2) % types.length; game.floorType = types[floorTypeIndex]; const isBossFloor = bossFloors.includes(game.floor); if (isBossFloor) { createBoss(); game.enemies = []; showBossDialogue('intro'); } else { createEnemies(); game.boss = null; createSideQuests(); } createItems(); createTraps(); createDoors(); createNPCs(); updateUI(); } function createBoss() { const bossTypes = [ { name: 'القائد الآلي', color: '#8B0000', health: 15, damage: 2, speed: 1.5 }, { name: 'الجنرال السايبورغ', color: '#4B0082', health: 20, damage: 2, speed: 1.8 }, { name: 'المارشال الحديدي', color: '#2F4F4F', health: 25, damage: 3, speed: 2 }, { name: 'الإمبراطور الميكانيكي', color: '#1C1C1C', health: 30, damage: 3, speed: 2.2 }, { name: 'ملك الظلام الآلي', color: '#000000', health: 40, damage: 4, speed: 2.5 } ]; const bossIndex = bossFloors.indexOf(game.floor); const bossData = bossTypes[bossIndex]; const diffMult = game.settings.difficulty === 'hard' ? 1.5 : game.settings.difficulty === 'easy' ? 0.7 : 1; game.boss = { x: 600, y: GROUND_Y - 80, width: 60, height: 80, health: Math.floor(bossData.health * diffMult), maxHealth: Math.floor(bossData.health * diffMult), name: bossData.name, color: bossData.color, damage: Math.floor(bossData.damage * diffMult), speed: bossData.speed, attackCooldown: 0, attackPattern: 0, hasShield: false, shieldCooldown: 0 }; } function createEnemies() { const enemyCount = Math.min(3 + game.floor, 8); game.enemies = []; const ranks = [ { name: 'جندي', color: '#696969', health: 2, damage: 1 }, { name: 'عريف', color: '#8B4513', health: 3, damage: 1 }, { name: 'رقيب', color: '#B22222', health: 4, damage: 2 }, { name: 'ملازم', color: '#FF4500', health: 5, damage: 2 }, { name: 'نقيب', color: '#DC143C', health: 6, damage: 2 } ]; const rankIndex = Math.min(Math.floor(game.floor / 2), ranks.length - 1); const currentRank = ranks[rankIndex]; for (let i = 0; i < enemyCount; i++) { const rand = Math.random(); let type; if (rand > 0.85 && game.floor > 3) type = 'sniper'; else if (rand > 0.75 && game.floor > 2) type = 'trap'; else if (rand > 0.65 && game.floor > 4) type = 'shield'; else if (rand > 0.5) type = 'flying'; else if (rand > 0.3) type = 'ground'; else type = 'beast'; game.enemies.push({ x: 200 + Math.random() * 400, y: type === 'flying' ? 200 + Math.random() * 100 : GROUND_Y - 35, width: type === 'beast' ? 45 : type === 'shield' ? 50 : 35, height: type === 'beast' ? 35 : 35, health: currentRank.health + (type === 'beast' ? 1 : 0) + (type === 'shield' ? 2 : 0), maxHealth: currentRank.health + (type === 'beast' ? 1 : 0) + (type === 'shield' ? 2 : 0), type: type, rank: currentRank.name, color: currentRank.color, damage: currentRank.damage, velocityX: (Math.random() - 0.5) * 2, velocityY: type === 'flying' ? (Math.random() - 0.5) * 2 : 0, attackCooldown: 0, hasShield: type === 'shield', willExplode: type === 'trap', explosionTimer: type === 'trap' ? 0 : null, isSniping: type === 'sniper', snipeTimer: 0 }); } } function createItems() { game.items = []; const itemCount = 3 + Math.floor(Math.random() * 4); for (let i = 0; i < itemCount; i++) { const rand = Math.random(); let type; if (rand > 0.85) type = 'treasure'; else if (rand > 0.7) type = 'key'; else if (rand > 0.5 && game.floor > 2 && !game.player.hasLamp) type = 'lamp'; else type = 'coin'; game.items.push({ x: 150 + Math.random() * 500, y: GROUND_Y - 20, width: 20, height: 20, type: type, value: type === 'treasure' ? 50 : type === 'coin' ? 10 : 0, isTreasure: type === 'treasure' }); } } function createTraps() { game.traps = []; const trapCount = Math.floor(game.floor / 2) + 2; for (let i = 0; i < trapCount; i++) { const trapType = Math.random() > 0.6 ? 'spike' : 'electric'; game.traps.push({ x: 200 + Math.random() * 400, y: GROUND_Y - 10, width: 40, height: 10, active: true, damage: 1, type: trapType }); } } function createDoors() { const keysNeeded = Math.floor(game.floor / 2) + 1; game.doors = [{ x: 700, y: GROUND_Y - 60, width: 50, height: 60, keysNeeded: keysNeeded, locked: true }]; } function createSideQuests() { game.sideQuests = []; if (Math.random() > 0.5) { game.sideQuests.push({ id: `rescue_${game.floor}`, type: 'rescue',
Settings
Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English