toastiselite commited on
Commit
410ba5d
·
verified ·
1 Parent(s): d1ba8fa

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +912 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Test
3
- emoji: 👀
4
- colorFrom: indigo
5
- colorTo: pink
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: test
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: purple
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,912 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Arcane Dystopia</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/controls/OrbitControls.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
11
+ <style>
12
+ body {
13
+ margin: 0;
14
+ overflow: hidden;
15
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
16
+ }
17
+ #game-container {
18
+ position: relative;
19
+ width: 100vw;
20
+ height: 100vh;
21
+ }
22
+ #ui-overlay {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ pointer-events: none;
29
+ }
30
+ .ui-panel {
31
+ pointer-events: auto;
32
+ background-color: rgba(20, 20, 30, 0.8);
33
+ border: 1px solid #4a5568;
34
+ border-radius: 8px;
35
+ padding: 10px;
36
+ color: #e2e8f0;
37
+ }
38
+ .ability {
39
+ transition: all 0.3s ease;
40
+ }
41
+ .ability:hover {
42
+ transform: scale(1.05);
43
+ box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
44
+ }
45
+ .cooldown {
46
+ position: absolute;
47
+ bottom: 0;
48
+ left: 0;
49
+ width: 100%;
50
+ background-color: rgba(255, 0, 0, 0.5);
51
+ transition: height 0.1s linear;
52
+ }
53
+ .quest-active {
54
+ border-left: 3px solid #48bb78;
55
+ }
56
+ .inventory-item {
57
+ transition: all 0.2s ease;
58
+ }
59
+ .inventory-item:hover {
60
+ transform: scale(1.1);
61
+ box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
62
+ }
63
+ #crosshair {
64
+ position: absolute;
65
+ top: 50%;
66
+ left: 50%;
67
+ transform: translate(-50%, -50%);
68
+ width: 20px;
69
+ height: 20px;
70
+ border: 2px solid rgba(255, 255, 255, 0.8);
71
+ border-radius: 50%;
72
+ pointer-events: none;
73
+ }
74
+ #crosshair::before, #crosshair::after {
75
+ content: '';
76
+ position: absolute;
77
+ background-color: rgba(255, 255, 255, 0.8);
78
+ }
79
+ #crosshair::before {
80
+ width: 2px;
81
+ height: 8px;
82
+ top: -10px;
83
+ left: 50%;
84
+ transform: translateX(-50%);
85
+ }
86
+ #crosshair::after {
87
+ width: 8px;
88
+ height: 2px;
89
+ left: -10px;
90
+ top: 50%;
91
+ transform: translateY(-50%);
92
+ }
93
+ </style>
94
+ </head>
95
+ <body class="bg-gray-900 text-white">
96
+ <div id="game-container">
97
+ <div id="ui-overlay" class="flex flex-col justify-between p-4">
98
+ <!-- Top Bar -->
99
+ <div class="flex justify-between items-start">
100
+ <!-- Player Stats -->
101
+ <div class="ui-panel flex space-x-6">
102
+ <div class="flex items-center space-x-2">
103
+ <i class="fas fa-heart text-red-500"></i>
104
+ <span id="health">100/100</span>
105
+ </div>
106
+ <div class="flex items-center space-x-2">
107
+ <i class="fas fa-bolt text-yellow-400"></i>
108
+ <span id="mana">150/150</span>
109
+ </div>
110
+ <div class="flex items-center space-x-2">
111
+ <i class="fas fa-coins text-yellow-300"></i>
112
+ <span id="gold">250</span>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Quest Info -->
117
+ <div id="quest-info" class="ui-panel max-w-xs hidden">
118
+ <div class="flex justify-between items-center mb-2">
119
+ <h3 class="font-bold" id="quest-title">Current Quest</h3>
120
+ <button id="close-quest" class="text-gray-400 hover:text-white">
121
+ <i class="fas fa-times"></i>
122
+ </button>
123
+ </div>
124
+ <p id="quest-description">No active quest</p>
125
+ <div class="mt-2">
126
+ <div class="w-full bg-gray-700 rounded-full h-2">
127
+ <div id="quest-progress" class="bg-green-500 h-2 rounded-full" style="width: 0%"></div>
128
+ </div>
129
+ <p class="text-xs mt-1 text-right" id="quest-progress-text">0%</p>
130
+ </div>
131
+ </div>
132
+ </div>
133
+
134
+ <!-- Center UI -->
135
+ <div class="flex justify-center">
136
+ <div id="crosshair"></div>
137
+ </div>
138
+
139
+ <!-- Bottom Bar -->
140
+ <div class="flex justify-between items-end">
141
+ <!-- Abilities -->
142
+ <div class="ui-panel flex space-x-4">
143
+ <div class="ability relative w-16 h-16 bg-gray-800 rounded-lg flex items-center justify-center cursor-pointer" data-ability="fireball">
144
+ <div class="cooldown" style="height: 0%"></div>
145
+ <i class="fas fa-fire text-2xl text-orange-500"></i>
146
+ <div class="absolute bottom-0 right-0 bg-gray-900 text-xs px-1 rounded-tl">Q</div>
147
+ </div>
148
+ <div class="ability relative w-16 h-16 bg-gray-800 rounded-lg flex items-center justify-center cursor-pointer" data-ability="frost-nova">
149
+ <div class="cooldown" style="height: 0%"></div>
150
+ <i class="fas fa-snowflake text-2xl text-blue-300"></i>
151
+ <div class="absolute bottom-0 right-0 bg-gray-900 text-xs px-1 rounded-tl">E</div>
152
+ </div>
153
+ <div class="ability relative w-16 h-16 bg-gray-800 rounded-lg flex items-center justify-center cursor-pointer" data-ability="lightning">
154
+ <div class="cooldown" style="height: 0%"></div>
155
+ <i class="fas fa-bolt text-2xl text-yellow-400"></i>
156
+ <div class="absolute bottom-0 right-0 bg-gray-900 text-xs px-1 rounded-tl">R</div>
157
+ </div>
158
+ <div class="ability relative w-16 h-16 bg-gray-800 rounded-lg flex items-center justify-center cursor-pointer" data-ability="teleport">
159
+ <div class="cooldown" style="height: 0%"></div>
160
+ <i class="fas fa-location-arrow text-2xl text-purple-400"></i>
161
+ <div class="absolute bottom-0 right-0 bg-gray-900 text-xs px-1 rounded-tl">F</div>
162
+ </div>
163
+ </div>
164
+
165
+ <!-- Inventory Button -->
166
+ <button id="inventory-btn" class="ui-panel p-3 rounded-full hover:bg-gray-700 transition">
167
+ <i class="fas fa-backpack text-xl"></i>
168
+ </button>
169
+ </div>
170
+
171
+ <!-- Inventory Modal -->
172
+ <div id="inventory-modal" class="hidden fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50">
173
+ <div class="ui-panel w-full max-w-2xl">
174
+ <div class="flex justify-between items-center mb-4">
175
+ <h2 class="text-xl font-bold">Inventory</h2>
176
+ <button id="close-inventory" class="text-gray-400 hover:text-white">
177
+ <i class="fas fa-times"></i>
178
+ </button>
179
+ </div>
180
+ <div class="grid grid-cols-4 gap-4" id="inventory-grid">
181
+ <!-- Inventory items will be added here -->
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ <!-- Quests Modal -->
187
+ <div id="quests-modal" class="hidden fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50">
188
+ <div class="ui-panel w-full max-w-2xl">
189
+ <div class="flex justify-between items-center mb-4">
190
+ <h2 class="text-xl font-bold">Quests</h2>
191
+ <button id="close-quests" class="text-gray-400 hover:text-white">
192
+ <i class="fas fa-times"></i>
193
+ </button>
194
+ </div>
195
+ <div class="space-y-4" id="quests-list">
196
+ <!-- Quests will be added here -->
197
+ </div>
198
+ </div>
199
+ </div>
200
+
201
+ <!-- Controls Help -->
202
+ <div id="controls-help" class="ui-panel absolute bottom-4 right-4 text-xs opacity-70 hover:opacity-100 transition">
203
+ <p>WASD: Move | SPACE: Jump | Q/E/R/F: Abilities | I: Inventory | J: Quests</p>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <script>
209
+ // Game State
210
+ const gameState = {
211
+ player: {
212
+ health: 100,
213
+ maxHealth: 100,
214
+ mana: 150,
215
+ maxMana: 150,
216
+ gold: 250,
217
+ position: { x: 0, y: 0, z: 0 },
218
+ rotation: { x: 0, y: 0 },
219
+ velocity: { x: 0, y: 0, z: 0 },
220
+ isGrounded: false,
221
+ abilities: {
222
+ fireball: { cooldown: 0, maxCooldown: 3, cost: 20 },
223
+ frostNova: { cooldown: 0, maxCooldown: 8, cost: 35 },
224
+ lightning: { cooldown: 0, maxCooldown: 15, cost: 50 },
225
+ teleport: { cooldown: 0, maxCooldown: 10, cost: 40 }
226
+ }
227
+ },
228
+ inventory: [
229
+ { id: 'health-potion', name: 'Health Potion', icon: 'fa-flask', quantity: 3 },
230
+ { id: 'mana-potion', name: 'Mana Potion', icon: 'fa-flask', quantity: 2 },
231
+ { id: 'ancient-scroll', name: 'Ancient Scroll', icon: 'fa-scroll', quantity: 1 },
232
+ { id: 'magic-orb', name: 'Magic Orb', icon: 'fa-globe', quantity: 1 }
233
+ ],
234
+ quests: [
235
+ {
236
+ id: 'initiation',
237
+ title: 'Arcane Initiation',
238
+ description: 'Prove your worth by casting 5 spells in the training grounds.',
239
+ progress: 0,
240
+ goal: 5,
241
+ reward: { gold: 100, item: 'enchanted-ring' },
242
+ completed: false
243
+ },
244
+ {
245
+ id: 'rebellion',
246
+ title: 'Spark of Rebellion',
247
+ description: 'Find and destroy 3 surveillance drones in the district.',
248
+ progress: 0,
249
+ goal: 3,
250
+ reward: { gold: 200, item: 'cloak-of-shadows' },
251
+ completed: false
252
+ },
253
+ {
254
+ id: 'artifact',
255
+ title: 'Lost Artifact',
256
+ description: 'Recover the ancient artifact from the ruins beneath the city.',
257
+ progress: 0,
258
+ goal: 1,
259
+ reward: { gold: 500, item: 'staff-of-power' },
260
+ completed: false
261
+ }
262
+ ],
263
+ activeQuest: 'initiation',
264
+ keys: {
265
+ w: false,
266
+ a: false,
267
+ s: false,
268
+ d: false,
269
+ space: false
270
+ },
271
+ scene: null,
272
+ camera: null,
273
+ renderer: null,
274
+ controls: null,
275
+ clock: new THREE.Clock(),
276
+ lastTime: 0
277
+ };
278
+
279
+ // Initialize Three.js scene
280
+ function initScene() {
281
+ const container = document.getElementById('game-container');
282
+
283
+ // Scene
284
+ gameState.scene = new THREE.Scene();
285
+ gameState.scene.background = new THREE.Color(0x111122);
286
+ gameState.scene.fog = new THREE.FogExp2(0x111122, 0.002);
287
+
288
+ // Camera
289
+ gameState.camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
290
+ gameState.camera.position.set(0, 2, 5);
291
+
292
+ // Renderer
293
+ gameState.renderer = new THREE.WebGLRenderer({ antialias: true });
294
+ gameState.renderer.setSize(window.innerWidth, window.innerHeight);
295
+ gameState.renderer.shadowMap.enabled = true;
296
+ container.appendChild(gameState.renderer.domElement);
297
+
298
+ // Controls
299
+ gameState.controls = new THREE.OrbitControls(gameState.camera, gameState.renderer.domElement);
300
+ gameState.controls.enableDamping = true;
301
+ gameState.controls.dampingFactor = 0.25;
302
+ gameState.controls.enableZoom = false;
303
+ gameState.controls.enablePan = false;
304
+
305
+ // Lights
306
+ const ambientLight = new THREE.AmbientLight(0x404040);
307
+ gameState.scene.add(ambientLight);
308
+
309
+ const directionalLight = new THREE.DirectionalLight(0xffffff, 0.8);
310
+ directionalLight.position.set(1, 1, 1);
311
+ directionalLight.castShadow = true;
312
+ gameState.scene.add(directionalLight);
313
+
314
+ // Ground
315
+ const groundGeometry = new THREE.PlaneGeometry(100, 100);
316
+ const groundMaterial = new THREE.MeshStandardMaterial({
317
+ color: 0x333344,
318
+ roughness: 0.8,
319
+ metalness: 0.2
320
+ });
321
+ const ground = new THREE.Mesh(groundGeometry, groundMaterial);
322
+ ground.rotation.x = -Math.PI / 2;
323
+ ground.receiveShadow = true;
324
+ gameState.scene.add(ground);
325
+
326
+ // Buildings
327
+ const buildingGeometry = new THREE.BoxGeometry(10, 15, 10);
328
+ const buildingMaterial = new THREE.MeshStandardMaterial({
329
+ color: 0x222233,
330
+ roughness: 0.7,
331
+ metalness: 0.3
332
+ });
333
+
334
+ for (let i = 0; i < 20; i++) {
335
+ const building = new THREE.Mesh(buildingGeometry, buildingMaterial);
336
+ building.position.x = (Math.random() - 0.5) * 80;
337
+ building.position.z = (Math.random() - 0.5) * 80;
338
+ building.position.y = 7.5;
339
+ building.castShadow = true;
340
+ building.receiveShadow = true;
341
+ gameState.scene.add(building);
342
+ }
343
+
344
+ // Player
345
+ const playerGeometry = new THREE.CapsuleGeometry(0.5, 1, 4, 8);
346
+ const playerMaterial = new THREE.MeshStandardMaterial({
347
+ color: 0x4a5568,
348
+ roughness: 0.5,
349
+ metalness: 0.5
350
+ });
351
+ gameState.player.mesh = new THREE.Mesh(playerGeometry, playerMaterial);
352
+ gameState.player.mesh.position.set(0, 1, 0);
353
+ gameState.player.mesh.castShadow = true;
354
+ gameState.scene.add(gameState.player.mesh);
355
+
356
+ // Event listeners
357
+ window.addEventListener('resize', onWindowResize);
358
+ document.addEventListener('keydown', onKeyDown);
359
+ document.addEventListener('keyup', onKeyUp);
360
+
361
+ // UI Event Listeners
362
+ document.querySelectorAll('.ability').forEach(ability => {
363
+ ability.addEventListener('click', () => castSpell(ability.dataset.ability));
364
+ });
365
+
366
+ document.getElementById('inventory-btn').addEventListener('click', openInventory);
367
+ document.getElementById('close-inventory').addEventListener('click', closeInventory);
368
+ document.getElementById('close-quest').addEventListener('click', () => {
369
+ document.getElementById('quest-info').classList.add('hidden');
370
+ });
371
+
372
+ // Initialize UI
373
+ updateUI();
374
+ loadInventory();
375
+ updateQuestUI();
376
+
377
+ // Start game loop
378
+ animate();
379
+ }
380
+
381
+ // Game loop
382
+ function animate() {
383
+ requestAnimationFrame(animate);
384
+
385
+ const deltaTime = gameState.clock.getDelta();
386
+ const time = gameState.clock.getElapsedTime();
387
+
388
+ // Update player movement
389
+ updatePlayer(deltaTime);
390
+
391
+ // Update cooldowns
392
+ updateCooldowns(deltaTime);
393
+
394
+ // Update controls
395
+ gameState.controls.update();
396
+
397
+ // Render scene
398
+ gameState.renderer.render(gameState.scene, gameState.camera);
399
+
400
+ // Update UI every 10 frames
401
+ if (Math.floor(time * 10) % 10 === 0) {
402
+ updateUI();
403
+ }
404
+
405
+ gameState.lastTime = time;
406
+ }
407
+
408
+ // Update player movement
409
+ function updatePlayer(deltaTime) {
410
+ const moveSpeed = 5;
411
+ const jumpForce = 8;
412
+ const gravity = -20;
413
+
414
+ // Movement direction
415
+ const direction = new THREE.Vector3();
416
+
417
+ if (gameState.keys.w) direction.z -= 1;
418
+ if (gameState.keys.s) direction.z += 1;
419
+ if (gameState.keys.a) direction.x -= 1;
420
+ if (gameState.keys.d) direction.x += 1;
421
+
422
+ // Normalize direction
423
+ if (direction.length() > 0) {
424
+ direction.normalize();
425
+ }
426
+
427
+ // Apply movement
428
+ const moveDistance = moveSpeed * deltaTime;
429
+ direction.multiplyScalar(moveDistance);
430
+
431
+ // Apply rotation to movement direction
432
+ direction.applyEuler(new THREE.Euler(0, gameState.camera.rotation.y, 0));
433
+
434
+ gameState.player.velocity.x = direction.x;
435
+ gameState.player.velocity.z = direction.z;
436
+
437
+ // Jumping
438
+ if (gameState.keys.space && gameState.player.isGrounded) {
439
+ gameState.player.velocity.y = jumpForce;
440
+ gameState.player.isGrounded = false;
441
+ }
442
+
443
+ // Apply gravity
444
+ gameState.player.velocity.y += gravity * deltaTime;
445
+
446
+ // Update position
447
+ gameState.player.mesh.position.x += gameState.player.velocity.x;
448
+ gameState.player.mesh.position.y += gameState.player.velocity.y;
449
+ gameState.player.mesh.position.z += gameState.player.velocity.z;
450
+
451
+ // Ground collision
452
+ if (gameState.player.mesh.position.y < 1) {
453
+ gameState.player.mesh.position.y = 1;
454
+ gameState.player.velocity.y = 0;
455
+ gameState.player.isGrounded = true;
456
+ }
457
+
458
+ // Update camera position to follow player
459
+ gameState.camera.position.x = gameState.player.mesh.position.x;
460
+ gameState.camera.position.z = gameState.player.mesh.position.z + 5;
461
+ gameState.camera.position.y = gameState.player.mesh.position.y + 2;
462
+ gameState.camera.lookAt(
463
+ gameState.player.mesh.position.x,
464
+ gameState.player.mesh.position.y + 1,
465
+ gameState.player.mesh.position.z
466
+ );
467
+ }
468
+
469
+ // Update ability cooldowns
470
+ function updateCooldowns(deltaTime) {
471
+ for (const ability in gameState.player.abilities) {
472
+ if (gameState.player.abilities[ability].cooldown > 0) {
473
+ gameState.player.abilities[ability].cooldown -= deltaTime;
474
+ if (gameState.player.abilities[ability].cooldown < 0) {
475
+ gameState.player.abilities[ability].cooldown = 0;
476
+ }
477
+
478
+ // Update UI
479
+ const abilityElement = document.querySelector(`.ability[data-ability="${ability}"]`);
480
+ if (abilityElement) {
481
+ const cooldownElement = abilityElement.querySelector('.cooldown');
482
+ const cooldownPercent = (gameState.player.abilities[ability].cooldown /
483
+ gameState.player.abilities[ability].maxCooldown) * 100;
484
+ cooldownElement.style.height = `${cooldownPercent}%`;
485
+ }
486
+ }
487
+ }
488
+ }
489
+
490
+ // Cast a spell
491
+ function castSpell(spellName) {
492
+ const ability = gameState.player.abilities[spellName];
493
+
494
+ // Check if ability is on cooldown or not enough mana
495
+ if (ability.cooldown > 0 || gameState.player.mana < ability.cost) {
496
+ // Play error sound or show feedback
497
+ return;
498
+ }
499
+
500
+ // Deduct mana
501
+ gameState.player.mana -= ability.cost;
502
+ ability.cooldown = ability.maxCooldown;
503
+
504
+ // Spell effects
505
+ switch (spellName) {
506
+ case 'fireball':
507
+ createFireball();
508
+ break;
509
+ case 'frost-nova':
510
+ createFrostNova();
511
+ break;
512
+ case 'lightning':
513
+ createLightning();
514
+ break;
515
+ case 'teleport':
516
+ teleportPlayer();
517
+ break;
518
+ }
519
+
520
+ // Update quest progress if it's the initiation quest
521
+ if (gameState.activeQuest === 'initiation' && !gameState.quests[0].completed) {
522
+ gameState.quests[0].progress++;
523
+ if (gameState.quests[0].progress >= gameState.quests[0].goal) {
524
+ completeQuest('initiation');
525
+ }
526
+ updateQuestUI();
527
+ }
528
+
529
+ updateUI();
530
+ }
531
+
532
+ // Create a fireball projectile
533
+ function createFireball() {
534
+ const fireballGeometry = new THREE.SphereGeometry(0.3, 16, 16);
535
+ const fireballMaterial = new THREE.MeshStandardMaterial({
536
+ color: 0xff6600,
537
+ emissive: 0xff3300,
538
+ emissiveIntensity: 1,
539
+ roughness: 0.1,
540
+ metalness: 0.3
541
+ });
542
+ const fireball = new THREE.Mesh(fireballGeometry, fireballMaterial);
543
+
544
+ // Position fireball in front of player
545
+ fireball.position.copy(gameState.player.mesh.position);
546
+ fireball.position.y += 1;
547
+
548
+ // Add light
549
+ const fireballLight = new THREE.PointLight(0xff6600, 2, 10);
550
+ fireball.add(fireballLight);
551
+
552
+ gameState.scene.add(fireball);
553
+
554
+ // Fireball direction
555
+ const direction = new THREE.Vector3(0, 0, -1);
556
+ direction.applyQuaternion(gameState.camera.quaternion);
557
+ direction.normalize();
558
+
559
+ // Fireball speed
560
+ const speed = 20;
561
+
562
+ // Animate fireball
563
+ const fireballInterval = setInterval(() => {
564
+ fireball.position.x += direction.x * speed * 0.016;
565
+ fireball.position.y += direction.y * speed * 0.016;
566
+ fireball.position.z += direction.z * speed * 0.016;
567
+
568
+ // Check if fireball is out of bounds
569
+ if (fireball.position.length() > 50) {
570
+ clearInterval(fireballInterval);
571
+ gameState.scene.remove(fireball);
572
+ }
573
+
574
+ // Check for collisions (simplified)
575
+ // In a real game, you'd use a physics engine for this
576
+ }, 16);
577
+
578
+ // Remove fireball after 3 seconds
579
+ setTimeout(() => {
580
+ clearInterval(fireballInterval);
581
+ gameState.scene.remove(fireball);
582
+ }, 3000);
583
+ }
584
+
585
+ // Create a frost nova effect
586
+ function createFrostNova() {
587
+ const frostGeometry = new THREE.SphereGeometry(5, 32, 32);
588
+ const frostMaterial = new THREE.MeshStandardMaterial({
589
+ color: 0x00aaff,
590
+ transparent: true,
591
+ opacity: 0.5,
592
+ roughness: 0.2,
593
+ metalness: 0.7
594
+ });
595
+ const frostNova = new THREE.Mesh(frostGeometry, frostMaterial);
596
+ frostNova.position.copy(gameState.player.mesh.position);
597
+ frostNova.position.y += 1;
598
+
599
+ // Add light
600
+ const frostLight = new THREE.PointLight(0x00aaff, 3, 10);
601
+ frostNova.add(frostLight);
602
+
603
+ gameState.scene.add(frostNova);
604
+
605
+ // Animate frost nova
606
+ let scale = 0.1;
607
+ const frostInterval = setInterval(() => {
608
+ scale += 0.1;
609
+ frostNova.scale.set(scale, scale, scale);
610
+
611
+ if (scale >= 1) {
612
+ clearInterval(frostInterval);
613
+
614
+ // Fade out
615
+ let opacity = 0.5;
616
+ const fadeInterval = setInterval(() => {
617
+ opacity -= 0.05;
618
+ frostMaterial.opacity = opacity;
619
+
620
+ if (opacity <= 0) {
621
+ clearInterval(fadeInterval);
622
+ gameState.scene.remove(frostNova);
623
+ }
624
+ }, 50);
625
+ }
626
+ }, 50);
627
+ }
628
+
629
+ // Create a lightning strike
630
+ function createLightning() {
631
+ const lightningGroup = new THREE.Group();
632
+ lightningGroup.position.copy(gameState.player.mesh.position);
633
+ lightningGroup.position.y += 10;
634
+
635
+ // Create multiple lightning bolts
636
+ for (let i = 0; i < 5; i++) {
637
+ const points = [];
638
+ const height = 10 + Math.random() * 5;
639
+ const segments = 10;
640
+
641
+ for (let j = 0; j <= segments; j++) {
642
+ const offset = j === 0 || j === segments ? 0 : Math.random() * 0.5 - 0.25;
643
+ points.push(new THREE.Vector3(
644
+ offset,
645
+ -height * (j / segments),
646
+ offset
647
+ ));
648
+ }
649
+
650
+ const lightningGeometry = new THREE.BufferGeometry().setFromPoints(points);
651
+ const lightningMaterial = new THREE.LineBasicMaterial({
652
+ color: 0x88ccff,
653
+ transparent: true,
654
+ opacity: 0.8
655
+ });
656
+
657
+ const lightning = new THREE.Line(lightningGeometry, lightningMaterial);
658
+ lightningGroup.add(lightning);
659
+ }
660
+
661
+ gameState.scene.add(lightningGroup);
662
+
663
+ // Add light
664
+ const lightningLight = new THREE.PointLight(0x88ccff, 5, 20);
665
+ lightningGroup.add(lightningLight);
666
+
667
+ // Fade out
668
+ let opacity = 0.8;
669
+ const fadeInterval = setInterval(() => {
670
+ opacity -= 0.05;
671
+ lightningGroup.children.forEach(child => {
672
+ if (child.material) child.material.opacity = opacity;
673
+ });
674
+
675
+ if (opacity <= 0) {
676
+ clearInterval(fadeInterval);
677
+ gameState.scene.remove(lightningGroup);
678
+ }
679
+ }, 50);
680
+ }
681
+
682
+ // Teleport player forward
683
+ function teleportPlayer() {
684
+ const distance = 8;
685
+ const direction = new THREE.Vector3(0, 0, -1);
686
+ direction.applyQuaternion(gameState.camera.quaternion);
687
+ direction.normalize();
688
+
689
+ gameState.player.mesh.position.x += direction.x * distance;
690
+ gameState.player.mesh.position.z += direction.z * distance;
691
+
692
+ // Create teleport effect
693
+ const teleportGeometry = new THREE.SphereGeometry(1, 32, 32);
694
+ const teleportMaterial = new THREE.MeshStandardMaterial({
695
+ color: 0xaa00ff,
696
+ transparent: true,
697
+ opacity: 0.7,
698
+ roughness: 0.1,
699
+ metalness: 0.8
700
+ });
701
+
702
+ const teleportStart = new THREE.Mesh(teleportGeometry, teleportMaterial);
703
+ teleportStart.position.copy(gameState.player.mesh.position);
704
+ teleportStart.position.y += 1;
705
+
706
+ const teleportEnd = new THREE.Mesh(teleportGeometry, teleportMaterial);
707
+ teleportEnd.position.copy(gameState.player.mesh.position);
708
+ teleportEnd.position.x -= direction.x * distance;
709
+ teleportEnd.position.z -= direction.z * distance;
710
+ teleportEnd.position.y += 1;
711
+
712
+ gameState.scene.add(teleportStart);
713
+ gameState.scene.add(teleportEnd);
714
+
715
+ // Add lights
716
+ const teleportLightStart = new THREE.PointLight(0xaa00ff, 3, 5);
717
+ teleportStart.add(teleportLightStart);
718
+
719
+ const teleportLightEnd = new THREE.PointLight(0xaa00ff, 3, 5);
720
+ teleportEnd.add(teleportLightEnd);
721
+
722
+ // Fade out
723
+ let scale = 1;
724
+ const teleportInterval = setInterval(() => {
725
+ scale += 0.1;
726
+ teleportStart.scale.set(scale, scale, scale);
727
+ teleportEnd.scale.set(scale, scale, scale);
728
+
729
+ teleportMaterial.opacity -= 0.05;
730
+
731
+ if (teleportMaterial.opacity <= 0) {
732
+ clearInterval(teleportInterval);
733
+ gameState.scene.remove(teleportStart);
734
+ gameState.scene.remove(teleportEnd);
735
+ }
736
+ }, 50);
737
+ }
738
+
739
+ // Complete a quest
740
+ function completeQuest(questId) {
741
+ const questIndex = gameState.quests.findIndex(q => q.id === questId);
742
+ if (questIndex === -1) return;
743
+
744
+ gameState.quests[questIndex].completed = true;
745
+
746
+ // Give rewards
747
+ const reward = gameState.quests[questIndex].reward;
748
+ gameState.gold += reward.gold;
749
+
750
+ if (reward.item) {
751
+ // Add item to inventory
752
+ const existingItem = gameState.inventory.find(item => item.id === reward.item);
753
+ if (existingItem) {
754
+ existingItem.quantity++;
755
+ } else {
756
+ // Define new items here
757
+ const newItems = {
758
+ 'enchanted-ring': { id: 'enchanted-ring', name: 'Enchanted Ring', icon: 'fa-ring', quantity: 1 },
759
+ 'cloak-of-shadows': { id: 'cloak-of-shadows', name: 'Cloak of Shadows', icon: 'fa-vest', quantity: 1 },
760
+ 'staff-of-power': { id: 'staff-of-power', name: 'Staff of Power', icon: 'fa-magic', quantity: 1 }
761
+ };
762
+
763
+ if (newItems[reward.item]) {
764
+ gameState.inventory.push(newItems[reward.item]);
765
+ }
766
+ }
767
+
768
+ loadInventory();
769
+ }
770
+
771
+ // Update UI
772
+ updateUI();
773
+ updateQuestUI();
774
+
775
+ // Move to next quest if available
776
+ if (questId === 'initiation') {
777
+ gameState.activeQuest = 'rebellion';
778
+ } else if (questId === 'rebellion') {
779
+ gameState.activeQuest = 'artifact';
780
+ }
781
+ }
782
+
783
+ // Open inventory
784
+ function openInventory() {
785
+ document.getElementById('inventory-modal').classList.remove('hidden');
786
+ }
787
+
788
+ // Close inventory
789
+ function closeInventory() {
790
+ document.getElementById('inventory-modal').classList.add('hidden');
791
+ }
792
+
793
+ // Load inventory items into UI
794
+ function loadInventory() {
795
+ const inventoryGrid = document.getElementById('inventory-grid');
796
+ inventoryGrid.innerHTML = '';
797
+
798
+ gameState.inventory.forEach(item => {
799
+ const itemElement = document.createElement('div');
800
+ itemElement.className = 'inventory-item ui-panel flex flex-col items-center p-2 cursor-pointer';
801
+ itemElement.innerHTML = `
802
+ <i class="fas ${item.icon} text-2xl mb-1"></i>
803
+ <span class="text-sm text-center">${item.name}</span>
804
+ ${item.quantity > 1 ? `<span class="absolute top-0 right-0 bg-gray-700 text-xs px-1 rounded-bl">${item.quantity}</span>` : ''}
805
+ `;
806
+
807
+ // Add click handler for potions
808
+ if (item.id.includes('potion')) {
809
+ itemElement.addEventListener('click', () => useItem(item.id));
810
+ }
811
+
812
+ inventoryGrid.appendChild(itemElement);
813
+ });
814
+ }
815
+
816
+ // Use an item
817
+ function useItem(itemId) {
818
+ const itemIndex = gameState.inventory.findIndex(item => item.id === itemId);
819
+ if (itemIndex === -1) return;
820
+
821
+ const item = gameState.inventory[itemIndex];
822
+
823
+ switch (itemId) {
824
+ case 'health-potion':
825
+ gameState.player.health = Math.min(gameState.player.health + 30, gameState.player.maxHealth);
826
+ break;
827
+ case 'mana-potion':
828
+ gameState.player.mana = Math.min(gameState.player.mana + 40, gameState.player.maxMana);
829
+ break;
830
+ }
831
+
832
+ // Remove item or decrement quantity
833
+ if (item.quantity > 1) {
834
+ item.quantity--;
835
+ } else {
836
+ gameState.inventory.splice(itemIndex, 1);
837
+ }
838
+
839
+ // Update UI
840
+ updateUI();
841
+ loadInventory();
842
+ }
843
+
844
+ // Update quest UI
845
+ function updateQuestUI() {
846
+ const activeQuest = gameState.quests.find(q => q.id === gameState.activeQuest);
847
+ if (!activeQuest) return;
848
+
849
+ document.getElementById('quest-title').textContent = activeQuest.title;
850
+ document.getElementById('quest-description').textContent = activeQuest.description;
851
+
852
+ const progressPercent = (activeQuest.progress / activeQuest.goal) * 100;
853
+ document.getElementById('quest-progress').style.width = `${progressPercent}%`;
854
+ document.getElementById('quest-progress-text').textContent = `${Math.round(progressPercent)}%`;
855
+
856
+ // Show quest info if not already shown
857
+ if (document.getElementById('quest-info').classList.contains('hidden')) {
858
+ document.getElementById('quest-info').classList.remove('hidden');
859
+ }
860
+ }
861
+
862
+ // Update UI elements
863
+ function updateUI() {
864
+ document.getElementById('health').textContent =
865
+ `${Math.floor(gameState.player.health)}/${gameState.player.maxHealth}`;
866
+ document.getElementById('mana').textContent =
867
+ `${Math.floor(gameState.player.mana)}/${gameState.player.maxMana}`;
868
+ document.getElementById('gold').textContent = gameState.player.gold;
869
+ }
870
+
871
+ // Window resize handler
872
+ function onWindowResize() {
873
+ gameState.camera.aspect = window.innerWidth / window.innerHeight;
874
+ gameState.camera.updateProjectionMatrix();
875
+ gameState.renderer.setSize(window.innerWidth, window.innerHeight);
876
+ }
877
+
878
+ // Key down handler
879
+ function onKeyDown(event) {
880
+ switch (event.key.toLowerCase()) {
881
+ case 'w': gameState.keys.w = true; break;
882
+ case 'a': gameState.keys.a = true; break;
883
+ case 's': gameState.keys.s = true; break;
884
+ case 'd': gameState.keys.d = true; break;
885
+ case ' ': gameState.keys.space = true; break;
886
+ case 'q': castSpell('fireball'); break;
887
+ case 'e': castSpell('frost-nova'); break;
888
+ case 'r': castSpell('lightning'); break;
889
+ case 'f': castSpell('teleport'); break;
890
+ case 'i': openInventory(); break;
891
+ case 'j':
892
+ document.getElementById('quest-info').classList.toggle('hidden');
893
+ break;
894
+ }
895
+ }
896
+
897
+ // Key up handler
898
+ function onKeyUp(event) {
899
+ switch (event.key.toLowerCase()) {
900
+ case 'w': gameState.keys.w = false; break;
901
+ case 'a': gameState.keys.a = false; break;
902
+ case 's': gameState.keys.s = false; break;
903
+ case 'd': gameState.keys.d = false; break;
904
+ case ' ': gameState.keys.space = false; break;
905
+ }
906
+ }
907
+
908
+ // Initialize the game when the page loads
909
+ window.onload = initScene;
910
+ </script>
911
+ <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=toastiselite/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
912
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ listen to my instructions make a game about magic spells set in a dystopian world make the movement WASD make a 3D MAP along with sleek abilties the abilties should recharge and theres also a questline and make an ingt