Add 3 files
Browse files- README.md +6 -4
- index.html +515 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: gray
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: https-huggingface-co-spaces-enzostvs-deepsite
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: gray
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,515 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ar" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>لعبة العداء القوية</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700;900&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Tajawal', sans-serif;
|
| 14 |
+
background-color: #1a1a2e;
|
| 15 |
+
color: white;
|
| 16 |
+
overflow-x: hidden;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.game-container {
|
| 20 |
+
position: relative;
|
| 21 |
+
height: 500px;
|
| 22 |
+
overflow: hidden;
|
| 23 |
+
background: linear-gradient(to bottom, #16213e, #0f3460);
|
| 24 |
+
border-radius: 15px;
|
| 25 |
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
.player {
|
| 29 |
+
position: absolute;
|
| 30 |
+
width: 60px;
|
| 31 |
+
height: 80px;
|
| 32 |
+
bottom: 100px;
|
| 33 |
+
left: 50px;
|
| 34 |
+
transition: transform 0.1s;
|
| 35 |
+
z-index: 10;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.obstacle {
|
| 39 |
+
position: absolute;
|
| 40 |
+
width: 50px;
|
| 41 |
+
height: 50px;
|
| 42 |
+
bottom: 100px;
|
| 43 |
+
right: -50px;
|
| 44 |
+
z-index: 5;
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.coin {
|
| 48 |
+
position: absolute;
|
| 49 |
+
width: 30px;
|
| 50 |
+
height: 30px;
|
| 51 |
+
z-index: 5;
|
| 52 |
+
animation: spin 2s linear infinite;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.ground {
|
| 56 |
+
position: absolute;
|
| 57 |
+
bottom: 0;
|
| 58 |
+
width: 100%;
|
| 59 |
+
height: 100px;
|
| 60 |
+
background-color: #533d2b;
|
| 61 |
+
z-index: 1;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.jump {
|
| 65 |
+
animation: jump 0.8s linear;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
@keyframes jump {
|
| 69 |
+
0% { transform: translateY(0); }
|
| 70 |
+
50% { transform: translateY(-150px); }
|
| 71 |
+
100% { transform: translateY(0); }
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
@keyframes spin {
|
| 75 |
+
0% { transform: rotate(0deg); }
|
| 76 |
+
100% { transform: rotate(360deg); }
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.moving-bg {
|
| 80 |
+
position: absolute;
|
| 81 |
+
top: 0;
|
| 82 |
+
left: 0;
|
| 83 |
+
width: 100%;
|
| 84 |
+
height: 100%;
|
| 85 |
+
background-image: url('https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80');
|
| 86 |
+
background-size: cover;
|
| 87 |
+
opacity: 0.2;
|
| 88 |
+
z-index: 0;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
.power-up {
|
| 92 |
+
position: absolute;
|
| 93 |
+
width: 40px;
|
| 94 |
+
height: 40px;
|
| 95 |
+
right: -40px;
|
| 96 |
+
z-index: 5;
|
| 97 |
+
animation: pulse 1s infinite;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
@keyframes pulse {
|
| 101 |
+
0% { transform: scale(1); }
|
| 102 |
+
50% { transform: scale(1.2); }
|
| 103 |
+
100% { transform: scale(1); }
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.game-over {
|
| 107 |
+
transform: scale(1.5) rotate(5deg);
|
| 108 |
+
transition: all 0.5s;
|
| 109 |
+
}
|
| 110 |
+
</style>
|
| 111 |
+
</head>
|
| 112 |
+
<body class="min-h-screen flex flex-col items-center justify-center p-4">
|
| 113 |
+
<div class="w-full max-w-4xl mx-auto">
|
| 114 |
+
<h1 class="text-4xl font-bold text-center mb-6 text-yellow-400">
|
| 115 |
+
<i class="fas fa-running mr-2"></i> لعبة العداء القوية
|
| 116 |
+
</h1>
|
| 117 |
+
|
| 118 |
+
<div class="flex justify-between items-center mb-4 px-4">
|
| 119 |
+
<div class="flex items-center">
|
| 120 |
+
<span class="text-xl font-bold text-yellow-400 mr-2">
|
| 121 |
+
<i class="fas fa-coins"></i> <span id="score">0</span>
|
| 122 |
+
</span>
|
| 123 |
+
<span class="text-xl font-bold text-red-500 ml-4">
|
| 124 |
+
<i class="fas fa-heart"></i> <span id="lives">3</span>
|
| 125 |
+
</span>
|
| 126 |
+
</div>
|
| 127 |
+
|
| 128 |
+
<div class="flex items-center">
|
| 129 |
+
<span class="text-xl font-bold text-blue-400">
|
| 130 |
+
<i class="fas fa-bolt"></i> <span id="power">0</span>%
|
| 131 |
+
</span>
|
| 132 |
+
</div>
|
| 133 |
+
</div>
|
| 134 |
+
|
| 135 |
+
<div class="game-container relative" id="gameContainer">
|
| 136 |
+
<div class="moving-bg"></div>
|
| 137 |
+
<div class="ground"></div>
|
| 138 |
+
|
| 139 |
+
<div id="player" class="player">
|
| 140 |
+
<img src="https://cdn-icons-png.flaticon.com/512/3899/3899618.png" alt="العداء" class="w-full h-full">
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<div id="gameOver" class="hidden absolute inset-0 flex flex-col items-center justify-center bg-black bg-opacity-70 z-20">
|
| 144 |
+
<h2 class="text-4xl font-bold text-red-500 mb-4">انتهت اللعبة!</h2>
|
| 145 |
+
<p class="text-2xl mb-6">النقاط: <span id="finalScore">0</span></p>
|
| 146 |
+
<button id="restartBtn" class="px-6 py-3 bg-yellow-500 text-black font-bold rounded-full hover:bg-yellow-400 transition">
|
| 147 |
+
<i class="fas fa-redo mr-2"></i> إعادة المحاولة
|
| 148 |
+
</button>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<div class="mt-6 flex justify-between items-center">
|
| 153 |
+
<div class="flex space-x-4">
|
| 154 |
+
<button id="jumpBtn" class="px-6 py-3 bg-blue-600 text-white font-bold rounded-full hover:bg-blue-500 transition">
|
| 155 |
+
<i class="fas fa-arrow-up mr-2"></i> قفز
|
| 156 |
+
</button>
|
| 157 |
+
<button id="powerBtn" class="px-6 py-3 bg-purple-600 text-white font-bold rounded-full hover:bg-purple-500 transition disabled:opacity-50" disabled>
|
| 158 |
+
<i class="fas fa-bolt mr-2"></i> سرعة خارقة
|
| 159 |
+
</button>
|
| 160 |
+
</div>
|
| 161 |
+
|
| 162 |
+
<div class="flex items-center">
|
| 163 |
+
<span class="text-lg mr-2">المستوى:</span>
|
| 164 |
+
<select id="levelSelect" class="bg-gray-800 text-white px-3 py-2 rounded">
|
| 165 |
+
<option value="1">سهل</option>
|
| 166 |
+
<option value="2">متوسط</option>
|
| 167 |
+
<option value="3">صعب</option>
|
| 168 |
+
</select>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<div class="mt-8 bg-gray-900 bg-opacity-50 p-4 rounded-lg">
|
| 173 |
+
<h3 class="text-xl font-bold mb-2 text-yellow-400">
|
| 174 |
+
<i class="fas fa-info-circle mr-2"></i> تعليمات اللعبة
|
| 175 |
+
</h3>
|
| 176 |
+
<ul class="list-disc list-inside space-y-1">
|
| 177 |
+
<li>اضغط زر القفز أو مفتاح المسافة للقفز فوق العقبات</li>
|
| 178 |
+
<li>اجمع العملات لزيادة نقاطك</li>
|
| 179 |
+
<li>اجمع وحدات الطاقة لتفعيل السرعة الخارقة</li>
|
| 180 |
+
<li>استخدم السرعة الخارقة لاجتياز العقبات الصعبة</li>
|
| 181 |
+
<li>لديك 3 محاولات فقط!</li>
|
| 182 |
+
</ul>
|
| 183 |
+
</div>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<script>
|
| 187 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 188 |
+
// عناصر اللعبة
|
| 189 |
+
const gameContainer = document.getElementById('gameContainer');
|
| 190 |
+
const player = document.getElementById('player');
|
| 191 |
+
const scoreElement = document.getElementById('score');
|
| 192 |
+
const livesElement = document.getElementById('lives');
|
| 193 |
+
const powerElement = document.getElementById('power');
|
| 194 |
+
const gameOverScreen = document.getElementById('gameOver');
|
| 195 |
+
const finalScoreElement = document.getElementById('finalScore');
|
| 196 |
+
const restartBtn = document.getElementById('restartBtn');
|
| 197 |
+
const jumpBtn = document.getElementById('jumpBtn');
|
| 198 |
+
const powerBtn = document.getElementById('powerBtn');
|
| 199 |
+
const levelSelect = document.getElementById('levelSelect');
|
| 200 |
+
|
| 201 |
+
// متغيرات اللعبة
|
| 202 |
+
let score = 0;
|
| 203 |
+
let lives = 3;
|
| 204 |
+
let power = 0;
|
| 205 |
+
let isJumping = false;
|
| 206 |
+
let isGameOver = false;
|
| 207 |
+
let gameSpeed = 5;
|
| 208 |
+
let isPowerActive = false;
|
| 209 |
+
let powerTimeout;
|
| 210 |
+
let gameInterval;
|
| 211 |
+
let obstacleInterval;
|
| 212 |
+
let coinInterval;
|
| 213 |
+
let powerUpInterval;
|
| 214 |
+
|
| 215 |
+
// مستويات الصعوبة
|
| 216 |
+
const levels = {
|
| 217 |
+
1: { speed: 5, obstacleFreq: 2000, coinFreq: 1500, powerFreq: 10000 },
|
| 218 |
+
2: { speed: 8, obstacleFreq: 1500, coinFreq: 1200, powerFreq: 8000 },
|
| 219 |
+
3: { speed: 12, obstacleFreq: 1000, coinFreq: 1000, powerFreq: 6000 }
|
| 220 |
+
};
|
| 221 |
+
|
| 222 |
+
// تهيئة اللعبة
|
| 223 |
+
function initGame() {
|
| 224 |
+
score = 0;
|
| 225 |
+
lives = 3;
|
| 226 |
+
power = 0;
|
| 227 |
+
isGameOver = false;
|
| 228 |
+
isPowerActive = false;
|
| 229 |
+
|
| 230 |
+
scoreElement.textContent = score;
|
| 231 |
+
livesElement.textContent = lives;
|
| 232 |
+
powerElement.textContent = power;
|
| 233 |
+
|
| 234 |
+
gameOverScreen.classList.add('hidden');
|
| 235 |
+
player.classList.remove('game-over');
|
| 236 |
+
|
| 237 |
+
// مسح جميع العقبات والعملات
|
| 238 |
+
document.querySelectorAll('.obstacle, .coin, .power-up').forEach(el => el.remove());
|
| 239 |
+
|
| 240 |
+
// تعيين سرعة اللعبة حسب المستوى
|
| 241 |
+
const level = parseInt(levelSelect.value);
|
| 242 |
+
gameSpeed = levels[level].speed;
|
| 243 |
+
|
| 244 |
+
// بدء فترات إنشاء العناصر
|
| 245 |
+
startIntervals(level);
|
| 246 |
+
|
| 247 |
+
// بدء حركة اللعبة
|
| 248 |
+
if (gameInterval) clearInterval(gameInterval);
|
| 249 |
+
gameInterval = setInterval(updateGame, 20);
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
// بدء فترات إنشاء العناصر
|
| 253 |
+
function startIntervals(level) {
|
| 254 |
+
if (obstacleInterval) clearInterval(obstacleInterval);
|
| 255 |
+
if (coinInterval) clearInterval(coinInterval);
|
| 256 |
+
if (powerUpInterval) clearInterval(powerUpInterval);
|
| 257 |
+
|
| 258 |
+
obstacleInterval = setInterval(createObstacle, levels[level].obstacleFreq);
|
| 259 |
+
coinInterval = setInterval(createCoin, levels[level].coinFreq);
|
| 260 |
+
powerUpInterval = setInterval(createPowerUp, levels[level].powerFreq);
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
// تحديث اللعبة
|
| 264 |
+
function updateGame() {
|
| 265 |
+
if (isGameOver) return;
|
| 266 |
+
|
| 267 |
+
// تحريك العقبات
|
| 268 |
+
document.querySelectorAll('.obstacle').forEach(obstacle => {
|
| 269 |
+
const obstacleRight = parseInt(window.getComputedStyle(obstacle).getPropertyValue('right'));
|
| 270 |
+
const newRight = obstacleRight + gameSpeed;
|
| 271 |
+
obstacle.style.right = `${newRight}px`;
|
| 272 |
+
|
| 273 |
+
// اكتشاف التصادم
|
| 274 |
+
if (checkCollision(player, obstacle)) {
|
| 275 |
+
handleCollision();
|
| 276 |
+
obstacle.remove();
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
// إزالة العقبات التي تجاوزت الشاشة
|
| 280 |
+
if (newRight > gameContainer.offsetWidth + 50) {
|
| 281 |
+
obstacle.remove();
|
| 282 |
+
}
|
| 283 |
+
});
|
| 284 |
+
|
| 285 |
+
// تحريك العملات
|
| 286 |
+
document.querySelectorAll('.coin').forEach(coin => {
|
| 287 |
+
const coinRight = parseInt(window.getComputedStyle(coin).getPropertyValue('right'));
|
| 288 |
+
const newRight = coinRight + gameSpeed;
|
| 289 |
+
coin.style.right = `${newRight}px`;
|
| 290 |
+
|
| 291 |
+
// اكتشاف جمع العملة
|
| 292 |
+
if (checkCollision(player, coin)) {
|
| 293 |
+
score += 10;
|
| 294 |
+
scoreElement.textContent = score;
|
| 295 |
+
coin.remove();
|
| 296 |
+
playSound('coin');
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
// إزالة العملات التي تجاوزت الشاشة
|
| 300 |
+
if (newRight > gameContainer.offsetWidth + 50) {
|
| 301 |
+
coin.remove();
|
| 302 |
+
}
|
| 303 |
+
});
|
| 304 |
+
|
| 305 |
+
// تحريك وحدات الطاقة
|
| 306 |
+
document.querySelectorAll('.power-up').forEach(powerUp => {
|
| 307 |
+
const powerUpRight = parseInt(window.getComputedStyle(powerUp).getPropertyValue('right'));
|
| 308 |
+
const newRight = powerUpRight + gameSpeed;
|
| 309 |
+
powerUp.style.right = `${newRight}px`;
|
| 310 |
+
|
| 311 |
+
// اكتشاف جمع وحدة الطاقة
|
| 312 |
+
if (checkCollision(player, powerUp)) {
|
| 313 |
+
power = Math.min(100, power + 25);
|
| 314 |
+
powerElement.textContent = power;
|
| 315 |
+
powerUp.remove();
|
| 316 |
+
playSound('power');
|
| 317 |
+
updatePowerButton();
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
// إزالة وحدات الطاقة التي تجاوزت الشاشة
|
| 321 |
+
if (newRight > gameContainer.offsetWidth + 50) {
|
| 322 |
+
powerUp.remove();
|
| 323 |
+
}
|
| 324 |
+
});
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
// إنشاء عقبة جديدة
|
| 328 |
+
function createObstacle() {
|
| 329 |
+
if (isGameOver) return;
|
| 330 |
+
|
| 331 |
+
const obstacle = document.createElement('div');
|
| 332 |
+
obstacle.className = 'obstacle';
|
| 333 |
+
|
| 334 |
+
// أنواع مختلفة من العقبات
|
| 335 |
+
const obstacleTypes = [
|
| 336 |
+
{ img: 'https://cdn-icons-png.flaticon.com/512/2821/2821637.png', height: 50 },
|
| 337 |
+
{ img: 'https://cdn-icons-png.flaticon.com/512/2821/2821772.png', height: 60 },
|
| 338 |
+
{ img: 'https://cdn-icons-png.flaticon.com/512/2821/2821797.png', height: 70 }
|
| 339 |
+
];
|
| 340 |
+
|
| 341 |
+
const type = obstacleTypes[Math.floor(Math.random() * obstacleTypes.length)];
|
| 342 |
+
obstacle.style.height = `${type.height}px`;
|
| 343 |
+
|
| 344 |
+
const img = document.createElement('img');
|
| 345 |
+
img.src = type.img;
|
| 346 |
+
img.className = 'w-full h-full';
|
| 347 |
+
obstacle.appendChild(img);
|
| 348 |
+
|
| 349 |
+
// وضع عشوائي للعقبة
|
| 350 |
+
const bottom = Math.random() > 0.5 ? 100 : 80;
|
| 351 |
+
obstacle.style.bottom = `${bottom}px`;
|
| 352 |
+
|
| 353 |
+
gameContainer.appendChild(obstacle);
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
// إنشاء عملة جديدة
|
| 357 |
+
function createCoin() {
|
| 358 |
+
if (isGameOver) return;
|
| 359 |
+
|
| 360 |
+
const coin = document.createElement('div');
|
| 361 |
+
coin.className = 'coin';
|
| 362 |
+
|
| 363 |
+
const img = document.createElement('img');
|
| 364 |
+
img.src = 'https://cdn-icons-png.flaticon.com/512/2821/2821970.png';
|
| 365 |
+
img.className = 'w-full h-full';
|
| 366 |
+
coin.appendChild(img);
|
| 367 |
+
|
| 368 |
+
// وضع عشوائي للعملة
|
| 369 |
+
const top = 100 + Math.random() * 200;
|
| 370 |
+
coin.style.top = `${top}px`;
|
| 371 |
+
coin.style.right = '0px';
|
| 372 |
+
|
| 373 |
+
gameContainer.appendChild(coin);
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
// إنشاء وحدة طاقة جديدة
|
| 377 |
+
function createPowerUp() {
|
| 378 |
+
if (isGameOver) return;
|
| 379 |
+
|
| 380 |
+
const powerUp = document.createElement('div');
|
| 381 |
+
powerUp.className = 'power-up';
|
| 382 |
+
|
| 383 |
+
const img = document.createElement('img');
|
| 384 |
+
img.src = 'https://cdn-icons-png.flaticon.com/512/3520/3520766.png';
|
| 385 |
+
img.className = 'w-full h-full';
|
| 386 |
+
powerUp.appendChild(img);
|
| 387 |
+
|
| 388 |
+
// وضع عشوائي لوحدة الطاقة
|
| 389 |
+
const top = 100 + Math.random() * 200;
|
| 390 |
+
powerUp.style.top = `${top}px`;
|
| 391 |
+
powerUp.style.right = '0px';
|
| 392 |
+
|
| 393 |
+
gameContainer.appendChild(powerUp);
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
// التحقق من التصادم
|
| 397 |
+
function checkCollision(player, element) {
|
| 398 |
+
const playerRect = player.getBoundingClientRect();
|
| 399 |
+
const elementRect = element.getBoundingClientRect();
|
| 400 |
+
|
| 401 |
+
return !(
|
| 402 |
+
playerRect.right < elementRect.left + 20 ||
|
| 403 |
+
playerRect.left > elementRect.right - 20 ||
|
| 404 |
+
playerRect.bottom < elementRect.top + 20 ||
|
| 405 |
+
playerRect.top > elementRect.bottom - 20
|
| 406 |
+
);
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
// التعامل مع التصادم
|
| 410 |
+
function handleCollision() {
|
| 411 |
+
if (isPowerActive) return;
|
| 412 |
+
|
| 413 |
+
lives--;
|
| 414 |
+
livesElement.textContent = lives;
|
| 415 |
+
player.classList.add('game-over');
|
| 416 |
+
playSound('hit');
|
| 417 |
+
|
| 418 |
+
setTimeout(() => {
|
| 419 |
+
player.classList.remove('game-over');
|
| 420 |
+
}, 300);
|
| 421 |
+
|
| 422 |
+
if (lives <= 0) {
|
| 423 |
+
endGame();
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
// إنهاء اللعبة
|
| 428 |
+
function endGame() {
|
| 429 |
+
isGameOver = true;
|
| 430 |
+
clearInterval(gameInterval);
|
| 431 |
+
clearInterval(obstacleInterval);
|
| 432 |
+
clearInterval(coinInterval);
|
| 433 |
+
clearInterval(powerUpInterval);
|
| 434 |
+
|
| 435 |
+
finalScoreElement.textContent = score;
|
| 436 |
+
gameOverScreen.classList.remove('hidden');
|
| 437 |
+
playSound('gameover');
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
// القفز
|
| 441 |
+
function jump() {
|
| 442 |
+
if (isJumping || isGameOver) return;
|
| 443 |
+
|
| 444 |
+
isJumping = true;
|
| 445 |
+
player.classList.add('jump');
|
| 446 |
+
playSound('jump');
|
| 447 |
+
|
| 448 |
+
setTimeout(() => {
|
| 449 |
+
player.classList.remove('jump');
|
| 450 |
+
isJumping = false;
|
| 451 |
+
}, 800);
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
// تفعيل السرعة الخارقة
|
| 455 |
+
function activatePower() {
|
| 456 |
+
if (power < 100 || isPowerActive || isGameOver) return;
|
| 457 |
+
|
| 458 |
+
isPowerActive = true;
|
| 459 |
+
power = 0;
|
| 460 |
+
powerElement.textContent = power;
|
| 461 |
+
powerBtn.disabled = true;
|
| 462 |
+
player.style.filter = 'drop-shadow(0 0 10px gold)';
|
| 463 |
+
playSound('powerup');
|
| 464 |
+
|
| 465 |
+
// زيادة السرعة مؤقتًا
|
| 466 |
+
const originalSpeed = gameSpeed;
|
| 467 |
+
gameSpeed *= 1.5;
|
| 468 |
+
|
| 469 |
+
powerTimeout = setTimeout(() => {
|
| 470 |
+
isPowerActive = false;
|
| 471 |
+
gameSpeed = originalSpeed;
|
| 472 |
+
player.style.filter = 'none';
|
| 473 |
+
updatePowerButton();
|
| 474 |
+
}, 3000);
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
// تحديث حالة زر الطاقة
|
| 478 |
+
function updatePowerButton() {
|
| 479 |
+
powerBtn.disabled = power < 100;
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
// تشغيل الأصوات
|
| 483 |
+
function playSound(type) {
|
| 484 |
+
// يمكن إضافة أصوات حقيقية هنا
|
| 485 |
+
console.log(`Playing sound: ${type}`);
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
// أحداث لوحة المفاتيح
|
| 489 |
+
document.addEventListener('keydown', (e) => {
|
| 490 |
+
if (e.code === 'Space') {
|
| 491 |
+
e.preventDefault();
|
| 492 |
+
jump();
|
| 493 |
+
}
|
| 494 |
+
});
|
| 495 |
+
|
| 496 |
+
// أحداث الأزرار
|
| 497 |
+
jumpBtn.addEventListener('click', jump);
|
| 498 |
+
powerBtn.addEventListener('click', activatePower);
|
| 499 |
+
restartBtn.addEventListener('click', initGame);
|
| 500 |
+
|
| 501 |
+
// تغيير مستوى الصعوبة
|
| 502 |
+
levelSelect.addEventListener('change', () => {
|
| 503 |
+
if (!isGameOver) {
|
| 504 |
+
const level = parseInt(levelSelect.value);
|
| 505 |
+
gameSpeed = levels[level].speed;
|
| 506 |
+
startIntervals(level);
|
| 507 |
+
}
|
| 508 |
+
});
|
| 509 |
+
|
| 510 |
+
// بدء اللعبة
|
| 511 |
+
initGame();
|
| 512 |
+
});
|
| 513 |
+
</script>
|
| 514 |
+
<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=gghjgff/https-huggingface-co-spaces-enzostvs-deepsite" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 515 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
اريد تصمم العبه جباره قويه جدا بيه كلشي العداء و كلشي
|