Spaces:
Running
Running
Add 2 files
Browse files- index.html +99 -628
- prompts.txt +2 -1
index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Simulateur de Camion Réaliste - La Réunion</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>
|
@@ -13,7 +13,6 @@
|
|
13 |
font-family: 'Poppins', sans-serif;
|
14 |
background-color: #0f172a;
|
15 |
color: white;
|
16 |
-
overflow: hidden;
|
17 |
margin: 0;
|
18 |
padding: 0;
|
19 |
}
|
@@ -30,22 +29,7 @@
|
|
30 |
justify-content: center;
|
31 |
align-items: center;
|
32 |
z-index: 9999;
|
33 |
-
|
34 |
-
|
35 |
-
.loading-bar {
|
36 |
-
width: 300px;
|
37 |
-
height: 20px;
|
38 |
-
background-color: #334155;
|
39 |
-
border-radius: 10px;
|
40 |
-
overflow: hidden;
|
41 |
-
margin-top: 20px;
|
42 |
-
}
|
43 |
-
|
44 |
-
.loading-progress {
|
45 |
-
height: 100%;
|
46 |
-
background: linear-gradient(90deg, #f59e0b, #f97316);
|
47 |
-
width: 0%;
|
48 |
-
transition: width 0.1s linear;
|
49 |
}
|
50 |
|
51 |
.game-container {
|
@@ -73,13 +57,6 @@
|
|
73 |
border: 1px solid rgba(255,255,255,0.1);
|
74 |
}
|
75 |
|
76 |
-
.dashboard-item {
|
77 |
-
display: flex;
|
78 |
-
flex-direction: column;
|
79 |
-
align-items: center;
|
80 |
-
min-width: 100px;
|
81 |
-
}
|
82 |
-
|
83 |
.progress-bar {
|
84 |
width: 100px;
|
85 |
height: 10px;
|
@@ -116,20 +93,6 @@
|
|
116 |
border: 2px solid white;
|
117 |
}
|
118 |
|
119 |
-
.mission-popup {
|
120 |
-
position: absolute;
|
121 |
-
top: 50%;
|
122 |
-
left: 50%;
|
123 |
-
transform: translate(-50%, -50%);
|
124 |
-
background-color: rgba(0,0,0,0.9);
|
125 |
-
padding: 20px;
|
126 |
-
border-radius: 10px;
|
127 |
-
text-align: center;
|
128 |
-
display: none;
|
129 |
-
backdrop-filter: blur(5px);
|
130 |
-
border: 1px solid #f59e0b;
|
131 |
-
}
|
132 |
-
|
133 |
#gameCanvas {
|
134 |
position: absolute;
|
135 |
top: 0;
|
@@ -138,31 +101,6 @@
|
|
138 |
height: 100%;
|
139 |
}
|
140 |
|
141 |
-
.controls-info {
|
142 |
-
position: absolute;
|
143 |
-
bottom: 100px;
|
144 |
-
left: 20px;
|
145 |
-
background-color: rgba(0,0,0,0.7);
|
146 |
-
padding: 10px;
|
147 |
-
border-radius: 5px;
|
148 |
-
font-size: 14px;
|
149 |
-
backdrop-filter: blur(5px);
|
150 |
-
border: 1px solid rgba(255,255,255,0.1);
|
151 |
-
}
|
152 |
-
|
153 |
-
.mission-progress {
|
154 |
-
position: absolute;
|
155 |
-
top: 20px;
|
156 |
-
left: 20px;
|
157 |
-
background-color: rgba(0,0,0,0.7);
|
158 |
-
padding: 10px;
|
159 |
-
border-radius: 5px;
|
160 |
-
font-size: 14px;
|
161 |
-
max-width: 300px;
|
162 |
-
backdrop-filter: blur(5px);
|
163 |
-
border: 1px solid rgba(255,255,255,0.1);
|
164 |
-
}
|
165 |
-
|
166 |
.mission-complete {
|
167 |
position: absolute;
|
168 |
top: 50%;
|
@@ -178,149 +116,6 @@
|
|
178 |
border: 2px solid #f59e0b;
|
179 |
}
|
180 |
|
181 |
-
.mission-complete h3 {
|
182 |
-
font-size: 24px;
|
183 |
-
color: #f59e0b;
|
184 |
-
margin-bottom: 20px;
|
185 |
-
}
|
186 |
-
|
187 |
-
.mission-complete button {
|
188 |
-
background-color: #f59e0b;
|
189 |
-
color: black;
|
190 |
-
border: none;
|
191 |
-
padding: 10px 20px;
|
192 |
-
border-radius: 5px;
|
193 |
-
font-weight: bold;
|
194 |
-
cursor: pointer;
|
195 |
-
margin-top: 20px;
|
196 |
-
transition: all 0.3s ease;
|
197 |
-
}
|
198 |
-
|
199 |
-
.mission-complete button:hover {
|
200 |
-
background-color: #f97316;
|
201 |
-
transform: translateY(-2px);
|
202 |
-
}
|
203 |
-
|
204 |
-
.weather-effects {
|
205 |
-
position: absolute;
|
206 |
-
top: 0;
|
207 |
-
left: 0;
|
208 |
-
width: 100%;
|
209 |
-
height: 100%;
|
210 |
-
pointer-events: none;
|
211 |
-
}
|
212 |
-
|
213 |
-
.rain {
|
214 |
-
position: absolute;
|
215 |
-
width: 2px;
|
216 |
-
height: 20px;
|
217 |
-
background-color: rgba(255,255,255,0.5);
|
218 |
-
animation: rain-fall linear infinite;
|
219 |
-
}
|
220 |
-
|
221 |
-
@keyframes rain-fall {
|
222 |
-
0% { transform: translateY(-100px); }
|
223 |
-
100% { transform: translateY(100vh); }
|
224 |
-
}
|
225 |
-
|
226 |
-
.time-display {
|
227 |
-
position: absolute;
|
228 |
-
top: 20px;
|
229 |
-
right: 240px;
|
230 |
-
background-color: rgba(0,0,0,0.7);
|
231 |
-
padding: 10px;
|
232 |
-
border-radius: 5px;
|
233 |
-
font-size: 14px;
|
234 |
-
backdrop-filter: blur(5px);
|
235 |
-
border: 1px solid rgba(255,255,255,0.1);
|
236 |
-
}
|
237 |
-
|
238 |
-
.ai-status {
|
239 |
-
position: absolute;
|
240 |
-
bottom: 20px;
|
241 |
-
right: 20px;
|
242 |
-
background-color: rgba(0,0,0,0.7);
|
243 |
-
padding: 10px;
|
244 |
-
border-radius: 5px;
|
245 |
-
font-size: 14px;
|
246 |
-
backdrop-filter: blur(5px);
|
247 |
-
border: 1px solid rgba(255,255,255,0.1);
|
248 |
-
}
|
249 |
-
|
250 |
-
/* Styles réalistes ajoutés */
|
251 |
-
.realistic-truck {
|
252 |
-
position: relative;
|
253 |
-
width: 120px;
|
254 |
-
height: 40px;
|
255 |
-
}
|
256 |
-
|
257 |
-
.truck-cabin {
|
258 |
-
position: absolute;
|
259 |
-
width: 40px;
|
260 |
-
height: 30px;
|
261 |
-
background-color: #3498db;
|
262 |
-
border-radius: 5px 0 0 5px;
|
263 |
-
}
|
264 |
-
|
265 |
-
.truck-trailer {
|
266 |
-
position: absolute;
|
267 |
-
left: 40px;
|
268 |
-
width: 80px;
|
269 |
-
height: 30px;
|
270 |
-
background-color: #2980b9;
|
271 |
-
border-radius: 0 5px 5px 0;
|
272 |
-
}
|
273 |
-
|
274 |
-
.wheel {
|
275 |
-
position: absolute;
|
276 |
-
width: 12px;
|
277 |
-
height: 12px;
|
278 |
-
background-color: #333;
|
279 |
-
border-radius: 50%;
|
280 |
-
bottom: -6px;
|
281 |
-
}
|
282 |
-
|
283 |
-
.wheel-front {
|
284 |
-
left: 10px;
|
285 |
-
}
|
286 |
-
|
287 |
-
.wheel-rear {
|
288 |
-
left: 30px;
|
289 |
-
}
|
290 |
-
|
291 |
-
.wheel-trailer {
|
292 |
-
left: 70px;
|
293 |
-
}
|
294 |
-
|
295 |
-
.road-sign {
|
296 |
-
position: absolute;
|
297 |
-
background-color: #f1c40f;
|
298 |
-
width: 20px;
|
299 |
-
height: 30px;
|
300 |
-
border-radius: 3px;
|
301 |
-
}
|
302 |
-
|
303 |
-
.road-sign:after {
|
304 |
-
content: "";
|
305 |
-
position: absolute;
|
306 |
-
bottom: -10px;
|
307 |
-
left: 8px;
|
308 |
-
width: 4px;
|
309 |
-
height: 10px;
|
310 |
-
background-color: #7f8c8d;
|
311 |
-
}
|
312 |
-
|
313 |
-
.pano-view {
|
314 |
-
position: absolute;
|
315 |
-
top: 0;
|
316 |
-
left: 0;
|
317 |
-
width: 100%;
|
318 |
-
height: 100%;
|
319 |
-
background-size: cover;
|
320 |
-
background-position: center;
|
321 |
-
transition: background-image 1s ease;
|
322 |
-
}
|
323 |
-
|
324 |
.start-screen {
|
325 |
position: fixed;
|
326 |
top: 0;
|
@@ -350,61 +145,55 @@
|
|
350 |
box-shadow: 0 10px 20px rgba(0,0,0,0.3);
|
351 |
}
|
352 |
|
353 |
-
.
|
354 |
-
|
355 |
-
|
356 |
}
|
357 |
|
358 |
-
.
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
|
|
365 |
}
|
366 |
-
|
367 |
-
/* Animation de chargement
|
368 |
-
@keyframes
|
369 |
-
0% { opacity:
|
370 |
-
|
371 |
-
100% { opacity: 0.5; }
|
372 |
}
|
373 |
-
|
374 |
-
.
|
375 |
-
animation:
|
376 |
}
|
377 |
</style>
|
378 |
</head>
|
379 |
-
<body
|
380 |
-
<!--
|
381 |
-
<div class="preload-images">
|
382 |
-
<img src="https://images.unsplash.com/photo-1584556818175-1a676b2657d3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80">
|
383 |
-
<img src="https://images.unsplash.com/photo-1566438480900-0609be27a4be?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80">
|
384 |
-
</div>
|
385 |
-
|
386 |
-
<!-- Start Screen -->
|
387 |
<div class="start-screen">
|
388 |
<h1 class="text-5xl font-bold text-yellow-400 mb-6">SIMULATEUR DE CAMION RÉUNIONNAIS</h1>
|
389 |
-
<p class="text-xl mb-8 max-w-2xl text-center">Conduisez un véritable camion à travers les paysages spectaculaires de La Réunion
|
390 |
<button id="startGameBtn" class="start-btn">
|
391 |
<i class="fas fa-truck mr-2"></i> DÉMARRER LA CONDUITE
|
392 |
</button>
|
|
|
|
|
|
|
393 |
</div>
|
394 |
|
395 |
-
<!-- Loading Screen -->
|
396 |
-
<div class="loading-screen">
|
397 |
-
<h1 class="text-4xl font-bold text-yellow-400 mb-4
|
398 |
<p class="text-lg mb-8" id="loadingStatus">Initialisation du système de conduite...</p>
|
399 |
-
<div class="loading-bar">
|
400 |
-
<div class="loading-progress" id="loadingProgress"></div>
|
401 |
-
</div>
|
402 |
<div class="mt-4 text-sm" id="loadingText">Connexion aux serveurs...</div>
|
403 |
</div>
|
404 |
|
405 |
<!-- Game Container -->
|
406 |
<div id="gameContainer" class="game-container">
|
407 |
-
<!-- Panoramic View
|
408 |
<div class="pano-view" id="panoView"></div>
|
409 |
|
410 |
<!-- Game UI Elements -->
|
@@ -424,34 +213,12 @@
|
|
424 |
<span class="text-sm mb-1">Distance</span>
|
425 |
<span id="distanceValue" class="text-xl font-bold">0 km</span>
|
426 |
</div>
|
427 |
-
<div class="dashboard-item">
|
428 |
-
<span class="text-sm mb-1">Poids</span>
|
429 |
-
<span id="weightValue" class="text-xl font-bold">0 kg</span>
|
430 |
-
</div>
|
431 |
</div>
|
432 |
|
433 |
<div class="game-map">
|
434 |
<div id="playerMarker" class="player-marker"></div>
|
435 |
</div>
|
436 |
|
437 |
-
<div id="missionProgress" class="mission-progress">
|
438 |
-
<strong>Mission en cours:</strong> Aucune mission active
|
439 |
-
</div>
|
440 |
-
|
441 |
-
<div class="time-display" id="timeDisplay">
|
442 |
-
<i class="fas fa-clock mr-2"></i> <span id="timeValue">06:00</span>
|
443 |
-
</div>
|
444 |
-
|
445 |
-
<div class="controls-info">
|
446 |
-
<p><strong>Contrôles réalistes:</strong></p>
|
447 |
-
<p>Accélérateur: Flèche haut/Z</p>
|
448 |
-
<p>Frein: Flèche bas/S</p>
|
449 |
-
<p>Direction: Flèches gauche/droite ou Q/D</p>
|
450 |
-
<p>Rétroviseurs: A/E</p>
|
451 |
-
<p>Phares: L</p>
|
452 |
-
<p>Klaxon: K</p>
|
453 |
-
</div>
|
454 |
-
|
455 |
<div id="missionComplete" class="mission-complete">
|
456 |
<!-- Will be filled dynamically -->
|
457 |
</div>
|
@@ -459,73 +226,33 @@
|
|
459 |
<button id="exitGameBtn" class="absolute top-4 left-4 bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full transition-all">
|
460 |
<i class="fas fa-times mr-2"></i> Quitter
|
461 |
</button>
|
462 |
-
|
463 |
-
<!-- Realistic rearview mirrors -->
|
464 |
-
<div id="leftMirror" class="absolute top-20 left-4 w-32 h-20 bg-gray-800 border-2 border-gray-600 rounded overflow-hidden" style="display: none;">
|
465 |
-
<div class="mirror-view" style="width: 100%; height: 100%; background-color: rgba(0,0,0,0.5);"></div>
|
466 |
-
</div>
|
467 |
-
|
468 |
-
<div id="rightMirror" class="absolute top-20 right-4 w-32 h-20 bg-gray-800 border-2 border-gray-600 rounded overflow-hidden" style="display: none;">
|
469 |
-
<div class="mirror-view" style="width: 100%; height: 100%; background-color: rgba(0,0,0,0.5);"></div>
|
470 |
-
</div>
|
471 |
</div>
|
472 |
|
473 |
<script>
|
474 |
-
// Optimisation: Préchargement des ressources
|
475 |
-
function preloadResources() {
|
476 |
-
const images = [
|
477 |
-
'https://images.unsplash.com/photo-1584556818175-1a676b2657d3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80',
|
478 |
-
'https://images.unsplash.com/photo-1566438480900-0609be27a4be?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80'
|
479 |
-
];
|
480 |
-
|
481 |
-
images.forEach(img => {
|
482 |
-
new Image().src = img;
|
483 |
-
});
|
484 |
-
}
|
485 |
-
|
486 |
-
// Démarrer le préchargement dès que la page est chargée
|
487 |
-
window.addEventListener('DOMContentLoaded', preloadResources);
|
488 |
-
|
489 |
// Game variables
|
490 |
let truckSpeed = 0;
|
491 |
const maxSpeed = 90;
|
492 |
-
const maxReverseSpeed = 20;
|
493 |
const acceleration = 0.5;
|
494 |
-
const braking = 1;
|
495 |
const deceleration = 0.3;
|
496 |
const steeringSpeed = 0.02;
|
497 |
|
498 |
let fuel = 100;
|
499 |
const fuelConsumption = 0.05;
|
500 |
let distance = 0;
|
501 |
-
let currentWeight = 0;
|
502 |
-
let hasCargo = false;
|
503 |
-
let currentMission = null;
|
504 |
-
let missionProgress = 0;
|
505 |
let gameTime = 6 * 60;
|
506 |
-
let isRaining = false;
|
507 |
-
let headlightsOn = false;
|
508 |
-
let mirrorsVisible = false;
|
509 |
|
510 |
-
//
|
511 |
const locations = [
|
512 |
{
|
513 |
name: "Saint-Denis",
|
514 |
-
|
515 |
-
lng: 55.4504,
|
516 |
-
img: "https://images.unsplash.com/photo-1584556818175-1a676b2657d3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
|
517 |
-
description: "Capitale de La Réunion avec son architecture coloniale"
|
518 |
},
|
519 |
{
|
520 |
name: "Saint-Pierre",
|
521 |
-
|
522 |
-
lng: 55.4789,
|
523 |
-
img: "https://images.unsplash.com/photo-1566438480900-0609be27a4be?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80",
|
524 |
-
description: "Ville dynamique du sud avec son port de plaisance"
|
525 |
}
|
526 |
];
|
527 |
|
528 |
-
// Current location index
|
529 |
let currentLocationIndex = 0;
|
530 |
|
531 |
// UI elements
|
@@ -533,51 +260,24 @@
|
|
533 |
const fuelElement = document.getElementById('fuelValue');
|
534 |
const fuelBar = document.getElementById('fuelBar');
|
535 |
const distanceElement = document.getElementById('distanceValue');
|
536 |
-
const weightElement = document.getElementById('weightValue');
|
537 |
-
const missionProgressElement = document.getElementById('missionProgress');
|
538 |
-
const missionCompleteElement = document.getElementById('missionComplete');
|
539 |
-
const playerMarker = document.getElementById('playerMarker');
|
540 |
-
const timeDisplay = document.getElementById('timeDisplay');
|
541 |
-
const timeValue = document.getElementById('timeValue');
|
542 |
const panoView = document.getElementById('panoView');
|
543 |
-
const
|
544 |
-
const rightMirror = document.getElementById('rightMirror');
|
545 |
-
const loadingProgress = document.getElementById('loadingProgress');
|
546 |
-
const loadingText = document.getElementById('loadingText');
|
547 |
-
const loadingStatus = document.getElementById('loadingStatus');
|
548 |
const gameContainer = document.getElementById('gameContainer');
|
549 |
-
const
|
550 |
-
const loadingScreen = document.querySelector('.loading-screen');
|
551 |
const startScreen = document.querySelector('.start-screen');
|
552 |
const startGameBtn = document.getElementById('startGameBtn');
|
|
|
553 |
|
554 |
-
//
|
555 |
-
|
556 |
-
startScreen.
|
557 |
-
loadingScreen.style.display = 'flex';
|
558 |
-
|
559 |
-
// Optimisation: Chargement accéléré
|
560 |
-
setTimeout(() => {
|
561 |
-
loadingStatus.textContent = "Chargement des textures...";
|
562 |
-
loadingProgress.style.width = "30%";
|
563 |
-
}, 200);
|
564 |
|
|
|
565 |
setTimeout(() => {
|
566 |
-
|
567 |
-
|
568 |
-
}, 600);
|
569 |
-
|
570 |
-
setTimeout(() => {
|
571 |
-
loadingStatus.textContent = "Chargement des modèles 3D...";
|
572 |
-
loadingProgress.style.width = "90%";
|
573 |
-
}, 1000);
|
574 |
-
|
575 |
-
setTimeout(() => {
|
576 |
-
loadingStatus.textContent = "Prêt à démarrer!";
|
577 |
-
loadingProgress.style.width = "100%";
|
578 |
-
loadingText.textContent = "Connexion établie avec les camions IRL!";
|
579 |
|
580 |
-
//
|
581 |
setTimeout(() => {
|
582 |
loadingScreen.style.display = 'none';
|
583 |
gameContainer.style.display = 'block';
|
@@ -588,43 +288,36 @@
|
|
588 |
// Démarrer la boucle de jeu
|
589 |
gameLoop();
|
590 |
|
591 |
-
// Démarrer une mission
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
startTimeSystem();
|
596 |
-
}, 500);
|
597 |
-
}, 1500);
|
598 |
});
|
599 |
|
600 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
function loadLocation(index) {
|
602 |
const location = locations[index];
|
603 |
-
|
604 |
-
// Set the panoramic view
|
605 |
panoView.style.backgroundImage = `url('${location.img}')`;
|
606 |
-
|
607 |
-
// Update mission text
|
608 |
-
if (currentMission) {
|
609 |
-
missionProgressElement.innerHTML = `
|
610 |
-
<strong>Localisation actuelle:</strong> ${location.name}<br>
|
611 |
-
<strong>Description:</strong> ${location.description}<br>
|
612 |
-
<strong>Mission:</strong> ${currentMission.cargo} vers ${currentMission.destination}<br>
|
613 |
-
<strong>Distance restante:</strong> ${(100 - missionProgress).toFixed(1)} km
|
614 |
-
`;
|
615 |
-
} else {
|
616 |
-
missionProgressElement.innerHTML = `
|
617 |
-
<strong>Localisation actuelle:</strong> ${location.name}<br>
|
618 |
-
<strong>Description:</strong> ${location.description}<br>
|
619 |
-
<strong>Mission:</strong> Aucune mission active
|
620 |
-
`;
|
621 |
-
}
|
622 |
-
|
623 |
-
// Update player marker on map
|
624 |
updatePlayerMarker();
|
625 |
}
|
626 |
|
627 |
-
// Update player marker
|
628 |
function updatePlayerMarker() {
|
629 |
const x = 100 + Math.random() * 50;
|
630 |
const y = 100 + Math.random() * 50;
|
@@ -632,119 +325,34 @@
|
|
632 |
playerMarker.style.top = `${y}px`;
|
633 |
}
|
634 |
|
635 |
-
// Start
|
636 |
-
function
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
if (Math.random() < 0.001) {
|
646 |
-
toggleRain(!isRaining);
|
647 |
-
}
|
648 |
-
}, 1000);
|
649 |
-
}
|
650 |
-
|
651 |
-
// Toggle rain effect
|
652 |
-
function toggleRain(enable) {
|
653 |
-
isRaining = enable;
|
654 |
-
const weatherEffects = document.querySelector('.weather-effects');
|
655 |
-
|
656 |
-
if (enable) {
|
657 |
-
weatherEffects.innerHTML = '';
|
658 |
-
for (let i = 0; i < 100; i++) {
|
659 |
-
const rainDrop = document.createElement('div');
|
660 |
-
rainDrop.className = 'rain';
|
661 |
-
rainDrop.style.left = `${Math.random() * 100}%`;
|
662 |
-
rainDrop.style.animationDuration = `${0.5 + Math.random() * 0.5}s`;
|
663 |
-
rainDrop.style.animationDelay = `${Math.random() * 2}s`;
|
664 |
-
weatherEffects.appendChild(rainDrop);
|
665 |
-
}
|
666 |
-
|
667 |
-
panoView.style.filter = 'brightness(0.7) contrast(1.1)';
|
668 |
-
} else {
|
669 |
-
weatherEffects.innerHTML = '';
|
670 |
-
panoView.style.filter = headlightsOn ? 'brightness(0.6) contrast(1.2)' : 'brightness(1) contrast(1)';
|
671 |
-
}
|
672 |
-
}
|
673 |
-
|
674 |
-
// Update time display
|
675 |
-
function updateTimeDisplay() {
|
676 |
-
const hours = Math.floor(gameTime / 60);
|
677 |
-
const minutes = gameTime % 60;
|
678 |
-
timeValue.textContent = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
|
679 |
-
}
|
680 |
-
|
681 |
-
// Update lighting based on time of day
|
682 |
-
function updateLighting() {
|
683 |
-
const hour = gameTime / 60;
|
684 |
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
if (!headlightsOn) {
|
689 |
-
toggleHeadlights(true);
|
690 |
-
}
|
691 |
-
} else {
|
692 |
-
panoView.style.filter = 'brightness(1) contrast(1)';
|
693 |
-
|
694 |
-
if (headlightsOn) {
|
695 |
-
toggleHeadlights(false);
|
696 |
-
}
|
697 |
-
}
|
698 |
-
}
|
699 |
-
|
700 |
-
// Toggle headlights
|
701 |
-
function toggleHeadlights(on) {
|
702 |
-
headlightsOn = on;
|
703 |
-
if (on) {
|
704 |
-
panoView.style.boxShadow = 'inset 0 0 100px 20px rgba(255, 255, 150, 0.2)';
|
705 |
-
} else {
|
706 |
-
panoView.style.boxShadow = 'none';
|
707 |
-
}
|
708 |
-
}
|
709 |
-
|
710 |
-
// Toggle mirrors
|
711 |
-
function toggleMirrors(show) {
|
712 |
-
mirrorsVisible = show;
|
713 |
-
if (show) {
|
714 |
-
leftMirror.style.display = 'block';
|
715 |
-
rightMirror.style.display = 'block';
|
716 |
-
} else {
|
717 |
-
leftMirror.style.display = 'none';
|
718 |
-
rightMirror.style.display = 'none';
|
719 |
-
}
|
720 |
}
|
721 |
|
722 |
-
// Main game loop
|
723 |
function gameLoop() {
|
724 |
handleControls();
|
725 |
-
checkMissionCompletion();
|
726 |
updateDashboard();
|
727 |
updateView();
|
728 |
-
|
729 |
requestAnimationFrame(gameLoop);
|
730 |
}
|
731 |
|
732 |
function updateView() {
|
733 |
-
if (truckSpeed > 0) {
|
734 |
-
|
735 |
-
|
736 |
-
loadLocation(currentLocationIndex);
|
737 |
-
}
|
738 |
-
} else if (truckSpeed < 0) {
|
739 |
-
if (Math.random() < -truckSpeed / 5000) {
|
740 |
-
currentLocationIndex = (currentLocationIndex - 1 + locations.length) % locations.length;
|
741 |
-
loadLocation(currentLocationIndex);
|
742 |
-
}
|
743 |
-
}
|
744 |
-
|
745 |
-
if (mirrorsVisible) {
|
746 |
-
leftMirror.querySelector('.mirror-view').style.backgroundColor = `rgba(0,0,0,${0.3 + Math.random()*0.2})`;
|
747 |
-
rightMirror.querySelector('.mirror-view').style.backgroundColor = `rgba(0,0,0,${0.3 + Math.random()*0.2})`;
|
748 |
}
|
749 |
}
|
750 |
|
@@ -753,101 +361,6 @@
|
|
753 |
fuelElement.textContent = `${fuel.toFixed(1)}%`;
|
754 |
fuelBar.style.width = `${fuel}%`;
|
755 |
distanceElement.textContent = `${distance.toFixed(1)} km`;
|
756 |
-
weightElement.textContent = `${currentWeight} kg`;
|
757 |
-
|
758 |
-
if (currentMission) {
|
759 |
-
missionProgressElement.innerHTML = `
|
760 |
-
<strong>Localisation actuelle:</strong> ${locations[currentLocationIndex].name}<br>
|
761 |
-
<strong>Description:</strong> ${locations[currentLocationIndex].description}<br>
|
762 |
-
<strong>Mission:</strong> ${currentMission.cargo} vers ${currentMission.destination}<br>
|
763 |
-
<strong>Distance restante:</strong> ${(100 - missionProgress).toFixed(1)} km
|
764 |
-
`;
|
765 |
-
}
|
766 |
-
}
|
767 |
-
|
768 |
-
function checkMissionCompletion() {
|
769 |
-
if (!currentMission) return;
|
770 |
-
|
771 |
-
if (missionProgress >= 100) {
|
772 |
-
completeMission();
|
773 |
-
}
|
774 |
-
}
|
775 |
-
|
776 |
-
function completeMission() {
|
777 |
-
missionCompleteElement.style.display = 'block';
|
778 |
-
missionCompleteElement.innerHTML = `
|
779 |
-
<h3>Livraison accomplie!</h3>
|
780 |
-
<p>Vous avez livré ${currentWeight} kg de ${currentMission.cargo} à ${currentMission.destination}</p>
|
781 |
-
<p>Temps de livraison: ${formatTime(gameTime)}</p>
|
782 |
-
<p>Localisation: ${locations[currentLocationIndex].name}</p>
|
783 |
-
<button id="nextMissionBtn" class="bg-yellow-500 hover:bg-yellow-600 text-black font-bold py-2 px-4 rounded">
|
784 |
-
<i class="fas fa-truck-moving mr-2"></i> Nouvelle mission
|
785 |
-
</button>
|
786 |
-
`;
|
787 |
-
|
788 |
-
currentMission = null;
|
789 |
-
hasCargo = false;
|
790 |
-
currentWeight = 0;
|
791 |
-
|
792 |
-
document.getElementById('nextMissionBtn').addEventListener('click', function() {
|
793 |
-
missionCompleteElement.style.display = 'none';
|
794 |
-
startRandomMission();
|
795 |
-
});
|
796 |
-
}
|
797 |
-
|
798 |
-
function formatTime(minutes) {
|
799 |
-
const hrs = Math.floor(minutes / 60);
|
800 |
-
const mins = minutes % 60;
|
801 |
-
return `${hrs}h${mins.toString().padStart(2, '0')}`;
|
802 |
-
}
|
803 |
-
|
804 |
-
function startRandomMission() {
|
805 |
-
const missions = [
|
806 |
-
{ cargo: "Canne à sucre", destination: "Saint-Denis", weight: 10000 },
|
807 |
-
{ cargo: "Charbon de bois", destination: "Saint-Pierre", weight: 8000 }
|
808 |
-
];
|
809 |
-
|
810 |
-
currentMission = missions[Math.floor(Math.random() * missions.length)];
|
811 |
-
hasCargo = true;
|
812 |
-
currentWeight = currentMission.weight;
|
813 |
-
missionProgress = 0;
|
814 |
-
|
815 |
-
const destIndex = locations.findIndex(loc => loc.name === currentMission.destination);
|
816 |
-
if (destIndex >= 0) {
|
817 |
-
missionProgress = Math.floor(Math.random() * 20);
|
818 |
-
}
|
819 |
-
|
820 |
-
missionProgressElement.innerHTML = `
|
821 |
-
<strong>Nouvelle mission:</strong> ${currentWeight} kg de ${currentMission.cargo}<br>
|
822 |
-
<strong>Destination:</strong> ${currentMission.destination}<br>
|
823 |
-
<strong>Distance:</strong> ${(100 - missionProgress).toFixed(1)} km
|
824 |
-
`;
|
825 |
-
|
826 |
-
showMissionStartPopup();
|
827 |
-
}
|
828 |
-
|
829 |
-
function showMissionStartPopup() {
|
830 |
-
const popup = document.createElement('div');
|
831 |
-
popup.className = 'mission-popup';
|
832 |
-
popup.innerHTML = `
|
833 |
-
<h3 class="text-xl font-bold text-yellow-400 mb-4">NOUVELLE MISSION</h3>
|
834 |
-
<p class="mb-2"><strong>Chargement:</strong> ${currentWeight} kg de ${currentMission.cargo}</p>
|
835 |
-
<p class="mb-2"><strong>Destination:</strong> ${currentMission.destination}</p>
|
836 |
-
<p class="mb-4"><strong>Distance:</strong> 100 km</p>
|
837 |
-
<button id="startMissionBtn" class="bg-yellow-500 hover:bg-yellow-600 text-black font-bold py-2 px-4 rounded">
|
838 |
-
<i class="fas fa-check mr-2"></i> Accepter la mission
|
839 |
-
</button>
|
840 |
-
`;
|
841 |
-
|
842 |
-
document.body.appendChild(popup);
|
843 |
-
popup.style.display = 'block';
|
844 |
-
|
845 |
-
document.getElementById('startMissionBtn').addEventListener('click', function() {
|
846 |
-
popup.style.display = 'none';
|
847 |
-
setTimeout(() => {
|
848 |
-
document.body.removeChild(popup);
|
849 |
-
}, 500);
|
850 |
-
});
|
851 |
}
|
852 |
|
853 |
// Handle keyboard controls
|
@@ -855,26 +368,11 @@
|
|
855 |
document.addEventListener('keydown', function(e) {
|
856 |
keys[e.key.toLowerCase()] = true;
|
857 |
|
858 |
-
|
|
|
859 |
gameContainer.style.display = 'none';
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
if (e.key === 'm' || e.key === 'M') {
|
864 |
-
document.querySelector('.game-map').style.display =
|
865 |
-
document.querySelector('.game-map').style.display === 'none' ? 'block' : 'none';
|
866 |
-
}
|
867 |
-
|
868 |
-
if (e.key === 'a' || e.key === 'A' || e.key === 'e' || e.key === 'E') {
|
869 |
-
toggleMirrors(!mirrorsVisible);
|
870 |
-
}
|
871 |
-
|
872 |
-
if (e.key === 'l' || e.key === 'L') {
|
873 |
-
toggleHeadlights(!headlightsOn);
|
874 |
-
}
|
875 |
-
|
876 |
-
if (e.key === 'k' || e.key === 'K') {
|
877 |
-
playHornSound();
|
878 |
}
|
879 |
});
|
880 |
|
@@ -882,66 +380,39 @@
|
|
882 |
keys[e.key.toLowerCase()] = false;
|
883 |
});
|
884 |
|
885 |
-
function playHornSound() {
|
886 |
-
const horn = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-truck-horn-715.mp3');
|
887 |
-
horn.volume = 0.3;
|
888 |
-
horn.play();
|
889 |
-
}
|
890 |
-
|
891 |
function handleControls() {
|
892 |
-
|
|
|
893 |
if (truckSpeed < maxSpeed) {
|
894 |
-
truckSpeed += acceleration
|
895 |
}
|
896 |
} else if (keys['arrowdown'] || keys['s']) {
|
897 |
-
if (truckSpeed >
|
898 |
-
truckSpeed
|
899 |
}
|
900 |
} else {
|
901 |
if (truckSpeed > 0) {
|
902 |
truckSpeed = Math.max(0, truckSpeed - deceleration);
|
903 |
-
} else if (truckSpeed < 0) {
|
904 |
-
truckSpeed = Math.min(0, truckSpeed + deceleration);
|
905 |
}
|
906 |
}
|
907 |
|
908 |
-
if (keys['arrowleft'] || keys['q']
|
909 |
-
|
910 |
-
if (truckSpeed > 0) {
|
911 |
-
currentLocationIndex = (currentLocationIndex - steeringEffect * 10 + locations.length) % locations.length;
|
912 |
-
} else if (truckSpeed < 0) {
|
913 |
-
currentLocationIndex = (currentLocationIndex + steeringEffect * 10) % locations.length;
|
914 |
-
}
|
915 |
} else if (keys['arrowright'] || keys['d']) {
|
916 |
-
|
917 |
-
if (truckSpeed > 0) {
|
918 |
-
currentLocationIndex = (currentLocationIndex + steeringEffect * 10) % locations.length;
|
919 |
-
} else if (truckSpeed < 0) {
|
920 |
-
currentLocationIndex = (currentLocationIndex - steeringEffect * 10 + locations.length) % locations.length;
|
921 |
-
}
|
922 |
}
|
923 |
|
924 |
if (truckSpeed > 0) {
|
925 |
distance += truckSpeed / 3600;
|
926 |
-
|
927 |
-
missionProgress = Math.min(100, missionProgress + truckSpeed / 36000);
|
928 |
-
}
|
929 |
}
|
930 |
-
|
931 |
-
if (Math.abs(truckSpeed) > 0) {
|
932 |
-
fuel = Math.max(0, fuel - fuelConsumption * Math.abs(truckSpeed) / 500);
|
933 |
-
if (fuel <= 0) {
|
934 |
-
truckSpeed = 0;
|
935 |
-
}
|
936 |
-
}
|
937 |
-
|
938 |
-
loadLocation(currentLocationIndex);
|
939 |
}
|
940 |
|
941 |
// Exit game button
|
942 |
-
exitGameBtn.addEventListener('click', function() {
|
943 |
gameContainer.style.display = 'none';
|
944 |
-
|
|
|
945 |
});
|
946 |
</script>
|
947 |
<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=docto41/routier-974" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Simulateur de Camion Réaliste - La Réunion (Mode Rapide)</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>
|
|
|
13 |
font-family: 'Poppins', sans-serif;
|
14 |
background-color: #0f172a;
|
15 |
color: white;
|
|
|
16 |
margin: 0;
|
17 |
padding: 0;
|
18 |
}
|
|
|
29 |
justify-content: center;
|
30 |
align-items: center;
|
31 |
z-index: 9999;
|
32 |
+
transition: opacity 0.5s ease;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
|
35 |
.game-container {
|
|
|
57 |
border: 1px solid rgba(255,255,255,0.1);
|
58 |
}
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
.progress-bar {
|
61 |
width: 100px;
|
62 |
height: 10px;
|
|
|
93 |
border: 2px solid white;
|
94 |
}
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
#gameCanvas {
|
97 |
position: absolute;
|
98 |
top: 0;
|
|
|
101 |
height: 100%;
|
102 |
}
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
.mission-complete {
|
105 |
position: absolute;
|
106 |
top: 50%;
|
|
|
116 |
border: 2px solid #f59e0b;
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
.start-screen {
|
120 |
position: fixed;
|
121 |
top: 0;
|
|
|
145 |
box-shadow: 0 10px 20px rgba(0,0,0,0.3);
|
146 |
}
|
147 |
|
148 |
+
.fast-load-btn {
|
149 |
+
background: linear-gradient(135deg, #10b981, #059669);
|
150 |
+
margin-top: 15px;
|
151 |
}
|
152 |
|
153 |
+
.pano-view {
|
154 |
+
position: absolute;
|
155 |
+
top: 0;
|
156 |
+
left: 0;
|
157 |
+
width: 100%;
|
158 |
+
height: 100%;
|
159 |
+
background-size: cover;
|
160 |
+
background-position: center;
|
161 |
}
|
162 |
+
|
163 |
+
/* Animation de chargement rapide */
|
164 |
+
@keyframes quickFade {
|
165 |
+
0% { opacity: 1; }
|
166 |
+
100% { opacity: 0; }
|
|
|
167 |
}
|
168 |
+
|
169 |
+
.quick-load {
|
170 |
+
animation: quickFade 0.5s forwards;
|
171 |
}
|
172 |
</style>
|
173 |
</head>
|
174 |
+
<body>
|
175 |
+
<!-- Start Screen avec option de chargement rapide -->
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
<div class="start-screen">
|
177 |
<h1 class="text-5xl font-bold text-yellow-400 mb-6">SIMULATEUR DE CAMION RÉUNIONNAIS</h1>
|
178 |
+
<p class="text-xl mb-8 max-w-2xl text-center">Conduisez un véritable camion à travers les paysages spectaculaires de La Réunion</p>
|
179 |
<button id="startGameBtn" class="start-btn">
|
180 |
<i class="fas fa-truck mr-2"></i> DÉMARRER LA CONDUITE
|
181 |
</button>
|
182 |
+
<button id="fastLoadBtn" class="start-btn fast-load-btn">
|
183 |
+
<i class="fas fa-bolt mr-2"></i> MODE RAPIDE (NO LOADING)
|
184 |
+
</button>
|
185 |
</div>
|
186 |
|
187 |
+
<!-- Loading Screen (masqué par défaut) -->
|
188 |
+
<div class="loading-screen" id="loadingScreen">
|
189 |
+
<h1 class="text-4xl font-bold text-yellow-400 mb-4">Chargement des données GPS</h1>
|
190 |
<p class="text-lg mb-8" id="loadingStatus">Initialisation du système de conduite...</p>
|
|
|
|
|
|
|
191 |
<div class="mt-4 text-sm" id="loadingText">Connexion aux serveurs...</div>
|
192 |
</div>
|
193 |
|
194 |
<!-- Game Container -->
|
195 |
<div id="gameContainer" class="game-container">
|
196 |
+
<!-- Panoramic View -->
|
197 |
<div class="pano-view" id="panoView"></div>
|
198 |
|
199 |
<!-- Game UI Elements -->
|
|
|
213 |
<span class="text-sm mb-1">Distance</span>
|
214 |
<span id="distanceValue" class="text-xl font-bold">0 km</span>
|
215 |
</div>
|
|
|
|
|
|
|
|
|
216 |
</div>
|
217 |
|
218 |
<div class="game-map">
|
219 |
<div id="playerMarker" class="player-marker"></div>
|
220 |
</div>
|
221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
<div id="missionComplete" class="mission-complete">
|
223 |
<!-- Will be filled dynamically -->
|
224 |
</div>
|
|
|
226 |
<button id="exitGameBtn" class="absolute top-4 left-4 bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full transition-all">
|
227 |
<i class="fas fa-times mr-2"></i> Quitter
|
228 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
</div>
|
230 |
|
231 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
// Game variables
|
233 |
let truckSpeed = 0;
|
234 |
const maxSpeed = 90;
|
|
|
235 |
const acceleration = 0.5;
|
|
|
236 |
const deceleration = 0.3;
|
237 |
const steeringSpeed = 0.02;
|
238 |
|
239 |
let fuel = 100;
|
240 |
const fuelConsumption = 0.05;
|
241 |
let distance = 0;
|
|
|
|
|
|
|
|
|
242 |
let gameTime = 6 * 60;
|
|
|
|
|
|
|
243 |
|
244 |
+
// Locations with placeholder images
|
245 |
const locations = [
|
246 |
{
|
247 |
name: "Saint-Denis",
|
248 |
+
img: "https://images.unsplash.com/photo-1584556818175-1a676b2657d3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80"
|
|
|
|
|
|
|
249 |
},
|
250 |
{
|
251 |
name: "Saint-Pierre",
|
252 |
+
img: "https://images.unsplash.com/photo-1566438480900-0609be27a4be?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80"
|
|
|
|
|
|
|
253 |
}
|
254 |
];
|
255 |
|
|
|
256 |
let currentLocationIndex = 0;
|
257 |
|
258 |
// UI elements
|
|
|
260 |
const fuelElement = document.getElementById('fuelValue');
|
261 |
const fuelBar = document.getElementById('fuelBar');
|
262 |
const distanceElement = document.getElementById('distanceValue');
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
const panoView = document.getElementById('panoView');
|
264 |
+
const playerMarker = document.getElementById('playerMarker');
|
|
|
|
|
|
|
|
|
265 |
const gameContainer = document.getElementById('gameContainer');
|
266 |
+
const loadingScreen = document.getElementById('loadingScreen');
|
|
|
267 |
const startScreen = document.querySelector('.start-screen');
|
268 |
const startGameBtn = document.getElementById('startGameBtn');
|
269 |
+
const fastLoadBtn = document.getElementById('fastLoadBtn');
|
270 |
|
271 |
+
// Mode de chargement rapide
|
272 |
+
fastLoadBtn.addEventListener('click', function() {
|
273 |
+
startScreen.classList.add('quick-load');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
+
// Simuler un chargement ultra rapide
|
276 |
setTimeout(() => {
|
277 |
+
startScreen.style.display = 'none';
|
278 |
+
loadingScreen.style.display = 'flex';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
+
// Afficher pendant très peu de temps
|
281 |
setTimeout(() => {
|
282 |
loadingScreen.style.display = 'none';
|
283 |
gameContainer.style.display = 'block';
|
|
|
288 |
// Démarrer la boucle de jeu
|
289 |
gameLoop();
|
290 |
|
291 |
+
// Démarrer une mission
|
292 |
+
startRandomMission();
|
293 |
+
}, 200);
|
294 |
+
}, 300);
|
|
|
|
|
|
|
295 |
});
|
296 |
|
297 |
+
// Mode normal
|
298 |
+
startGameBtn.addEventListener('click', function() {
|
299 |
+
startScreen.style.display = 'none';
|
300 |
+
loadingScreen.style.display = 'flex';
|
301 |
+
|
302 |
+
// Chargement accéléré
|
303 |
+
setTimeout(() => {
|
304 |
+
loadingScreen.style.display = 'none';
|
305 |
+
gameContainer.style.display = 'block';
|
306 |
+
|
307 |
+
loadLocation(currentLocationIndex);
|
308 |
+
gameLoop();
|
309 |
+
startRandomMission();
|
310 |
+
}, 800);
|
311 |
+
});
|
312 |
+
|
313 |
+
// Load location
|
314 |
function loadLocation(index) {
|
315 |
const location = locations[index];
|
|
|
|
|
316 |
panoView.style.backgroundImage = `url('${location.img}')`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
317 |
updatePlayerMarker();
|
318 |
}
|
319 |
|
320 |
+
// Update player marker
|
321 |
function updatePlayerMarker() {
|
322 |
const x = 100 + Math.random() * 50;
|
323 |
const y = 100 + Math.random() * 50;
|
|
|
325 |
playerMarker.style.top = `${y}px`;
|
326 |
}
|
327 |
|
328 |
+
// Start random mission
|
329 |
+
function startRandomMission() {
|
330 |
+
// Mission simple pour le mode rapide
|
331 |
+
const missionComplete = document.getElementById('missionComplete');
|
332 |
+
missionComplete.innerHTML = `
|
333 |
+
<h3 class="text-xl font-bold text-yellow-400 mb-4">Mission Rapide</h3>
|
334 |
+
<p class="mb-4">Transportez des marchandises à travers l'île</p>
|
335 |
+
<p class="text-sm">Utilisez les flèches directionnelles pour conduire</p>
|
336 |
+
`;
|
337 |
+
missionComplete.style.display = 'block';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
|
339 |
+
setTimeout(() => {
|
340 |
+
missionComplete.style.display = 'none';
|
341 |
+
}, 3000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
}
|
343 |
|
344 |
+
// Main game loop (simplifié pour le mode rapide)
|
345 |
function gameLoop() {
|
346 |
handleControls();
|
|
|
347 |
updateDashboard();
|
348 |
updateView();
|
|
|
349 |
requestAnimationFrame(gameLoop);
|
350 |
}
|
351 |
|
352 |
function updateView() {
|
353 |
+
if (truckSpeed > 0 && Math.random() < truckSpeed / 5000) {
|
354 |
+
currentLocationIndex = (currentLocationIndex + 1) % locations.length;
|
355 |
+
loadLocation(currentLocationIndex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
}
|
357 |
}
|
358 |
|
|
|
361 |
fuelElement.textContent = `${fuel.toFixed(1)}%`;
|
362 |
fuelBar.style.width = `${fuel}%`;
|
363 |
distanceElement.textContent = `${distance.toFixed(1)} km`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
}
|
365 |
|
366 |
// Handle keyboard controls
|
|
|
368 |
document.addEventListener('keydown', function(e) {
|
369 |
keys[e.key.toLowerCase()] = true;
|
370 |
|
371 |
+
// Touche E pour quitter
|
372 |
+
if (e.key === 'e') {
|
373 |
gameContainer.style.display = 'none';
|
374 |
+
startScreen.style.display = 'flex';
|
375 |
+
startScreen.classList.remove('quick-load');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
}
|
377 |
});
|
378 |
|
|
|
380 |
keys[e.key.toLowerCase()] = false;
|
381 |
});
|
382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
function handleControls() {
|
384 |
+
// Contrôles simplifiés
|
385 |
+
if (keys['arrowup'] || keys['z']) {
|
386 |
if (truckSpeed < maxSpeed) {
|
387 |
+
truckSpeed += acceleration;
|
388 |
}
|
389 |
} else if (keys['arrowdown'] || keys['s']) {
|
390 |
+
if (truckSpeed > 0) {
|
391 |
+
truckSpeed = Math.max(0, truckSpeed - deceleration * 2);
|
392 |
}
|
393 |
} else {
|
394 |
if (truckSpeed > 0) {
|
395 |
truckSpeed = Math.max(0, truckSpeed - deceleration);
|
|
|
|
|
396 |
}
|
397 |
}
|
398 |
|
399 |
+
if (keys['arrowleft'] || keys['q']) {
|
400 |
+
currentLocationIndex = (currentLocationIndex - 0.1 + locations.length) % locations.length;
|
|
|
|
|
|
|
|
|
|
|
401 |
} else if (keys['arrowright'] || keys['d']) {
|
402 |
+
currentLocationIndex = (currentLocationIndex + 0.1) % locations.length;
|
|
|
|
|
|
|
|
|
|
|
403 |
}
|
404 |
|
405 |
if (truckSpeed > 0) {
|
406 |
distance += truckSpeed / 3600;
|
407 |
+
fuel = Math.max(0, fuel - fuelConsumption * truckSpeed / 500);
|
|
|
|
|
408 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
}
|
410 |
|
411 |
// Exit game button
|
412 |
+
document.getElementById('exitGameBtn').addEventListener('click', function() {
|
413 |
gameContainer.style.display = 'none';
|
414 |
+
startScreen.style.display = 'flex';
|
415 |
+
startScreen.classList.remove('quick-load');
|
416 |
});
|
417 |
</script>
|
418 |
<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=docto41/routier-974" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
prompts.txt
CHANGED
@@ -6,4 +6,5 @@ ACTIVE LES IA AFIN ILS FONT FONCTIONNER LES JEUX
|
|
6 |
Jappel a mon armée de creer mon jeux de simulateur de conduite de camion en temp réel sur les route de l'iles de la reunion
|
7 |
je conduire avec des vrai camion pas des jeux , je veux voir les vrai paysage reelement
|
8 |
DEMARRER LES JEUX
|
9 |
-
les chargement des jeux sont trop lent pour declenche le jeu
|
|
|
|
6 |
Jappel a mon armée de creer mon jeux de simulateur de conduite de camion en temp réel sur les route de l'iles de la reunion
|
7 |
je conduire avec des vrai camion pas des jeux , je veux voir les vrai paysage reelement
|
8 |
DEMARRER LES JEUX
|
9 |
+
les chargement des jeux sont trop lent pour declenche le jeu
|
10 |
+
declencher le jeu en mode rapide
|