Add 3 files
Browse files- README.md +7 -5
- index.html +938 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 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: train
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: purple
|
| 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,938 @@
|
|
| 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="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Indian Railways Simulator</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=Poppins:wght@300;400;500;600;700&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Poppins', sans-serif;
|
| 14 |
+
background-color: #111827;
|
| 15 |
+
color: white;
|
| 16 |
+
overflow: hidden;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.train-body {
|
| 20 |
+
background: linear-gradient(90deg, #d10a11 60%, white 60%);
|
| 21 |
+
border-radius: 8px;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.coach-body {
|
| 25 |
+
background: linear-gradient(90deg, #003580 60%, white 60%);
|
| 26 |
+
border-radius: 8px;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.platform-tiles {
|
| 30 |
+
background: repeating-linear-gradient(
|
| 31 |
+
90deg,
|
| 32 |
+
#d1d5db,
|
| 33 |
+
#d1d5db 20px,
|
| 34 |
+
#9ca3af 20px,
|
| 35 |
+
#9ca3af 40px
|
| 36 |
+
);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
.signal-green {
|
| 40 |
+
box-shadow: 0 0 20px 5px rgba(74, 222, 128, 0.7);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.signal-yellow {
|
| 44 |
+
box-shadow: 0 0 20px 5px rgba(234, 179, 8, 0.7);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
.signal-red {
|
| 48 |
+
box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.7);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.fog-effect {
|
| 52 |
+
position: absolute;
|
| 53 |
+
width: 100%;
|
| 54 |
+
height: 100%;
|
| 55 |
+
background: rgba(255, 255, 255, 0.2);
|
| 56 |
+
backdrop-filter: blur(5px);
|
| 57 |
+
pointer-events: none;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.rain-effect {
|
| 61 |
+
position: absolute;
|
| 62 |
+
width: 100%;
|
| 63 |
+
height: 100%;
|
| 64 |
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><line x1="0" y1="0" x2="200" y2="200" stroke="rgba(255,255,255,0.2)" stroke-width="1"/></svg>');
|
| 65 |
+
animation: rain 0.5s linear infinite;
|
| 66 |
+
pointer-events: none;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
@keyframes rain {
|
| 70 |
+
0% { background-position: 0 0; }
|
| 71 |
+
100% { background-position: 200px 200px; }
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.gauge-fill {
|
| 75 |
+
transition: height 0.3s ease;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.cabin-panel {
|
| 79 |
+
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
|
| 80 |
+
border-radius: 8px;
|
| 81 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.button-glow:active {
|
| 85 |
+
box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.5);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
#gameCanvas {
|
| 89 |
+
border-radius: 8px;
|
| 90 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
.passenger {
|
| 94 |
+
animation: passenger-walk 4s infinite linear;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
@keyframes passenger-walk {
|
| 98 |
+
0% { transform: translateX(-50px); opacity: 0; }
|
| 99 |
+
10% { opacity: 1; }
|
| 100 |
+
90% { opacity: 1; }
|
| 101 |
+
100% { transform: translateX(50px); opacity: 0; }
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.blinking {
|
| 105 |
+
animation: blink 1s infinite;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
@keyframes blink {
|
| 109 |
+
0%, 100% { opacity: 1; }
|
| 110 |
+
50% { opacity: 0.5; }
|
| 111 |
+
}
|
| 112 |
+
</style>
|
| 113 |
+
</head>
|
| 114 |
+
<body class="h-screen flex flex-col">
|
| 115 |
+
<!-- Header -->
|
| 116 |
+
<header class="bg-red-800 py-2 px-4 flex justify-between items-center border-b-2 border-yellow-500">
|
| 117 |
+
<div class="flex items-center">
|
| 118 |
+
<img src="https://upload.wikimedia.org/wikipedia/en/thumb/3/37/Indian_Railways.svg/1200px-Indian_Railways.svg.png" alt="Indian Railways Logo" class="h-12 mr-3">
|
| 119 |
+
<h1 class="text-2xl font-bold">INDIAN RAILWAYS TRAIN SIMULATOR</h1>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="flex items-center space-x-4">
|
| 122 |
+
<div class="bg-black bg-opacity-50 px-3 py-1 rounded-full flex items-center">
|
| 123 |
+
<i class="fas fa-rupee-sign text-yellow-400 mr-2"></i>
|
| 124 |
+
<span id="score">12,450</span>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="bg-black bg-opacity-50 px-3 py-1 rounded-full flex items-center">
|
| 127 |
+
<i class="fas fa-user-tie text-blue-400 mr-2"></i>
|
| 128 |
+
<span>Asst. Loco Pilot</span>
|
| 129 |
+
</div>
|
| 130 |
+
<button class="bg-yellow-500 hover:bg-yellow-600 text-black px-4 py-1 rounded-full font-semibold">
|
| 131 |
+
<i class="fas fa-cog mr-2"></i>Settings
|
| 132 |
+
</button>
|
| 133 |
+
</div>
|
| 134 |
+
</header>
|
| 135 |
+
|
| 136 |
+
<!-- Main Game Area -->
|
| 137 |
+
<main class="flex-1 flex overflow-hidden relative">
|
| 138 |
+
<!-- Left Panel - Controls -->
|
| 139 |
+
<div class="w-80 bg-gray-900 p-4 flex flex-col border-r border-gray-700">
|
| 140 |
+
<div class="cabin-panel p-4 mb-4">
|
| 141 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">LOCO CONTROLS</h2>
|
| 142 |
+
|
| 143 |
+
<div class="mb-4">
|
| 144 |
+
<div class="flex justify-between items-center mb-1">
|
| 145 |
+
<span class="text-sm">THROTTLE</span>
|
| 146 |
+
<span class="text-xs bg-blue-900 px-2 py-1 rounded" id="throttle-value">0%</span>
|
| 147 |
+
</div>
|
| 148 |
+
<input type="range" min="0" max="100" value="0" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" id="throttle">
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div class="mb-4">
|
| 152 |
+
<div class="flex justify-between items-center mb-1">
|
| 153 |
+
<span class="text-sm">BRAKE</span>
|
| 154 |
+
<span class="text-xs bg-red-900 px-2 py-1 rounded" id="brake-value">0%</span>
|
| 155 |
+
</div>
|
| 156 |
+
<input type="range" min="0" max="100" value="0" class="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" id="brake">
|
| 157 |
+
</div>
|
| 158 |
+
|
| 159 |
+
<div class="grid grid-cols-3 gap-3 mb-4">
|
| 160 |
+
<button class="bg-blue-700 hover:bg-blue-600 py-2 rounded button-glow" id="horn">
|
| 161 |
+
<i class="fas fa-bullhorn"></i>
|
| 162 |
+
<div class="text-xs mt-1">HORN</div>
|
| 163 |
+
</button>
|
| 164 |
+
<button class="bg-gray-700 hover:bg-gray-600 py-2 rounded button-glow" id="headlight">
|
| 165 |
+
<i class="fas fa-lightbulb"></i>
|
| 166 |
+
<div class="text-xs mt-1">LIGHTS</div>
|
| 167 |
+
</button>
|
| 168 |
+
<button class="bg-green-700 hover:bg-green-600 py-2 rounded button-glow" id="pantograph">
|
| 169 |
+
<i class="fas fa-bolt"></i>
|
| 170 |
+
<div class="text-xs mt-1">PANTO</div>
|
| 171 |
+
</button>
|
| 172 |
+
<button class="bg-purple-700 hover:bg-purple-600 py-2 rounded button-glow" id="doors">
|
| 173 |
+
<i class="fas fa-door-open"></i>
|
| 174 |
+
<div class="text-xs mt-1">DOORS</div>
|
| 175 |
+
</button>
|
| 176 |
+
<button class="bg-yellow-700 hover:bg-yellow-600 py-2 rounded button-glow" id="sand">
|
| 177 |
+
<i class="fas fa-filter"></i>
|
| 178 |
+
<div class="text-xs mt-1">SAND</div>
|
| 179 |
+
</button>
|
| 180 |
+
<button class="bg-red-700 hover:bg-red-600 py-2 rounded button-glow" id="emergency">
|
| 181 |
+
<i class="fas fa-exclamation-triangle"></i>
|
| 182 |
+
<div class="text-xs mt-1">E-STOP</div>
|
| 183 |
+
</button>
|
| 184 |
+
</div>
|
| 185 |
+
|
| 186 |
+
<div class="border-t border-gray-600 pt-3">
|
| 187 |
+
<div class="flex justify-between text-sm mb-1">
|
| 188 |
+
<span>SPEED</span>
|
| 189 |
+
<span id="speed-value">0 km/h</span>
|
| 190 |
+
</div>
|
| 191 |
+
<div class="h-2 bg-gray-700 rounded-full mb-3">
|
| 192 |
+
<div class="h-2 bg-green-500 rounded-full" id="speed-bar" style="width: 0%"></div>
|
| 193 |
+
</div>
|
| 194 |
+
|
| 195 |
+
<div class="flex justify-between text-sm mb-1">
|
| 196 |
+
<span>POWER</span>
|
| 197 |
+
<span id="power-value">0%</span>
|
| 198 |
+
</div>
|
| 199 |
+
<div class="h-2 bg-gray-700 rounded-full">
|
| 200 |
+
<div class="h-2 bg-blue-500 rounded-full" id="power-bar" style="width: 0%"></div>
|
| 201 |
+
</div>
|
| 202 |
+
</div>
|
| 203 |
+
</div>
|
| 204 |
+
|
| 205 |
+
<div class="cabin-panel p-4 mb-4">
|
| 206 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">TRAIN INFO</h2>
|
| 207 |
+
<div class="space-y-2">
|
| 208 |
+
<div class="flex justify-between">
|
| 209 |
+
<span class="text-gray-400">Train No.:</span>
|
| 210 |
+
<span>12952</span>
|
| 211 |
+
</div>
|
| 212 |
+
<div class="flex justify-between">
|
| 213 |
+
<span class="text-gray-400">Name:</span>
|
| 214 |
+
<span>Rajdhani Express</span>
|
| 215 |
+
</div>
|
| 216 |
+
<div class="flex justify-between">
|
| 217 |
+
<span class="text-gray-400">Loco:</span>
|
| 218 |
+
<span>WAP-7 #30242</span>
|
| 219 |
+
</div>
|
| 220 |
+
<div class="flex justify-between">
|
| 221 |
+
<span class="text-gray-400">Route:</span>
|
| 222 |
+
<span>NDLS - CSTM</span>
|
| 223 |
+
</div>
|
| 224 |
+
<div class="flex justify-between">
|
| 225 |
+
<span class="text-gray-400">Next Stop:</span>
|
| 226 |
+
<span class="text-yellow-300">Bhopal (BPL)</span>
|
| 227 |
+
</div>
|
| 228 |
+
<div class="flex justify-between">
|
| 229 |
+
<span class="text-gray-400">Distance:</span>
|
| 230 |
+
<span>148.3 km</span>
|
| 231 |
+
</div>
|
| 232 |
+
<div class="flex justify-between">
|
| 233 |
+
<span class="text-gray-400">Time:</span>
|
| 234 |
+
<span>2h 18m</span>
|
| 235 |
+
</div>
|
| 236 |
+
<div class="flex justify-between">
|
| 237 |
+
<span class="text-gray-400">Punctuality:</span>
|
| 238 |
+
<span class="text-green-400">+3 min</span>
|
| 239 |
+
</div>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
|
| 243 |
+
<div class="cabin-panel p-4 flex-1">
|
| 244 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">SIGNALS & ATC</h2>
|
| 245 |
+
<div class="flex justify-center mb-4">
|
| 246 |
+
<div class="signal-red w-8 h-8 rounded-full bg-red-600 border border-gray-400 mr-2"></div>
|
| 247 |
+
<div class="signal-yellow w-8 h-8 rounded-full bg-yellow-500 border border-gray-400 mr-2"></div>
|
| 248 |
+
<div class="signal-green w-8 h-8 rounded-full bg-green-500 border border-gray-400"></div>
|
| 249 |
+
</div>
|
| 250 |
+
<div class="bg-black bg-opacity-50 p-2 rounded mb-3">
|
| 251 |
+
<div class="text-xs text-gray-400 mb-1">CURRENT SIGNAL</div>
|
| 252 |
+
<div class="text-xl font-mono text-center blinking">RED</div>
|
| 253 |
+
</div>
|
| 254 |
+
<div class="bg-black bg-opacity-50 p-2 rounded">
|
| 255 |
+
<div class="text-xs text-gray-400 mb-1">ATC SPEED LIMIT</div>
|
| 256 |
+
<div class="text-xl font-mono text-center">110 km/h</div>
|
| 257 |
+
</div>
|
| 258 |
+
</div>
|
| 259 |
+
</div>
|
| 260 |
+
|
| 261 |
+
<!-- Center Panel - Game View -->
|
| 262 |
+
<div class="flex-1 relative overflow-hidden">
|
| 263 |
+
<!-- Weather effects will be added here dynamically -->
|
| 264 |
+
<div id="weather-effects"></div>
|
| 265 |
+
|
| 266 |
+
<!-- Canvas for 3D rendering -->
|
| 267 |
+
<canvas id="gameCanvas" class="absolute inset-0 w-full h-full"></canvas>
|
| 268 |
+
|
| 269 |
+
<!-- Station Announcement Banner -->
|
| 270 |
+
<div class="absolute bottom-4 left-1/2 transform -translate-x-1/2 bg-black bg-opacity-70 px-6 py-2 rounded-full flex items-center">
|
| 271 |
+
<i class="fas fa-bullhorn text-yellow-400 mr-3"></i>
|
| 272 |
+
<div class="marquee">
|
| 273 |
+
<span class="announcement-text">Attention please! Train number 12952 Rajdhani Express arriving shortly on platform number 3. Passengers are requested to...</span>
|
| 274 |
+
</div>
|
| 275 |
+
</div>
|
| 276 |
+
|
| 277 |
+
<!-- Speed Limit Indicator -->
|
| 278 |
+
<div class="absolute top-4 right-4 bg-black bg-opacity-70 border-2 border-white rounded-full w-16 h-16 flex items-center justify-center">
|
| 279 |
+
<div class="text-2xl font-bold">110</div>
|
| 280 |
+
</div>
|
| 281 |
+
|
| 282 |
+
<!-- Mini Map -->
|
| 283 |
+
<div class="absolute top-4 left-1/2 transform -translate-x-1/2 bg-black bg-opacity-50 p-2 rounded-lg">
|
| 284 |
+
<div class="w-48 h-24 bg-gray-800 relative">
|
| 285 |
+
<div class="absolute inset-0 bg-green-900 opacity-30"></div>
|
| 286 |
+
<div class="absolute top-1/2 left-0 right-0 h-1 bg-yellow-400"></div>
|
| 287 |
+
<div class="absolute top-1/2 left-1/4 transform -translate-y-1/2 -translate-x-1/2 w-2 h-2 bg-white rounded-full"></div>
|
| 288 |
+
<div class="absolute top-1/2 left-3/4 transform -translate-y-1/2 -translate-x-1/2 w-3 h-3 bg-red-500 rounded-full"></div>
|
| 289 |
+
<div class="absolute bottom-1 left-2 text-xs">BPL</div>
|
| 290 |
+
<div class="absolute bottom-1 right-2 text-xs">NDLS</div>
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
|
| 295 |
+
<!-- Right Panel - Coach View and Tasks -->
|
| 296 |
+
<div class="w-80 bg-gray-900 p-4 flex flex-col border-l border-gray-700">
|
| 297 |
+
<div class="cabin-panel p-4 mb-4">
|
| 298 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">COACH VIEW</h2>
|
| 299 |
+
<div class="flex overflow-x-auto pb-2 space-x-2">
|
| 300 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 301 |
+
<div class="w-12 h-16 train-body mb-1"></div>
|
| 302 |
+
<div class="text-xs">WAP-7</div>
|
| 303 |
+
</div>
|
| 304 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 305 |
+
<div class="w-12 h-16 coach-body mb-1"></div>
|
| 306 |
+
<div class="text-xs">S1</div>
|
| 307 |
+
</div>
|
| 308 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 309 |
+
<div class="w-12 h-16 coach-body mb-1"></div>
|
| 310 |
+
<div class="text-xs">S2</div>
|
| 311 |
+
</div>
|
| 312 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 313 |
+
<div class="w-12 h-16 coach-body mb-1"></div>
|
| 314 |
+
<div class="text-xs">S3</div>
|
| 315 |
+
</div>
|
| 316 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 317 |
+
<div class="w-12 h-16 coach-body mb-1"></div>
|
| 318 |
+
<div class="text-xs">S4</div>
|
| 319 |
+
</div>
|
| 320 |
+
<div class="flex-shrink-0 w-16 h-24 bg-blue-900 rounded flex flex-col items-center justify-center">
|
| 321 |
+
<div class="w-12 h-16 coach-body mb-1"></div>
|
| 322 |
+
<div class="text-xs">S5</div>
|
| 323 |
+
</div>
|
| 324 |
+
</div>
|
| 325 |
+
|
| 326 |
+
<div class="mt-4 bg-black bg-opacity-30 p-2 rounded">
|
| 327 |
+
<div class="flex justify-between text-sm mb-1">
|
| 328 |
+
<span class="text-gray-400">Passengers:</span>
|
| 329 |
+
<span>432/480</span>
|
| 330 |
+
</div>
|
| 331 |
+
<div class="h-2 bg-gray-700 rounded-full">
|
| 332 |
+
<div class="h-2 bg-green-500 rounded-full" style="width: 90%"></div>
|
| 333 |
+
</div>
|
| 334 |
+
<div class="flex justify-between text-sm mt-2">
|
| 335 |
+
<span class="text-gray-400">Satisfaction:</span>
|
| 336 |
+
<span class="text-yellow-300">84%</span>
|
| 337 |
+
</div>
|
| 338 |
+
</div>
|
| 339 |
+
</div>
|
| 340 |
+
|
| 341 |
+
<div class="cabin-panel p-4 mb-4 flex-1">
|
| 342 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">TASKS & OBJECTIVES</h2>
|
| 343 |
+
<div class="space-y-3">
|
| 344 |
+
<div class="flex items-start">
|
| 345 |
+
<div class="w-5 h-5 rounded-full bg-green-500 flex items-center justify-center mr-2 mt-0.5">
|
| 346 |
+
<i class="fas fa-check text-xs text-white"></i>
|
| 347 |
+
</div>
|
| 348 |
+
<div>
|
| 349 |
+
<div class="text-sm">Depart New Delhi on time</div>
|
| 350 |
+
<div class="text-xs text-gray-400">+250 points</div>
|
| 351 |
+
</div>
|
| 352 |
+
</div>
|
| 353 |
+
<div class="flex items-start">
|
| 354 |
+
<div class="w-5 h-5 rounded-full bg-green-500 flex items-center justify-center mr-2 mt-0.5">
|
| 355 |
+
<i class="fas fa-check text-xs text-white"></i>
|
| 356 |
+
</div>
|
| 357 |
+
<div>
|
| 358 |
+
<div class="text-sm">Maintain speed through Ghaziabad</div>
|
| 359 |
+
<div class="text-xs text-gray-400">+180 points</div>
|
| 360 |
+
</div>
|
| 361 |
+
</div>
|
| 362 |
+
<div class="flex items-start">
|
| 363 |
+
<div class="w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center mr-2 mt-0.5">
|
| 364 |
+
<i class="fas fa-spinner text-xs text-white"></i>
|
| 365 |
+
</div>
|
| 366 |
+
<div>
|
| 367 |
+
<div class="text-sm">Arrive Bhopal within ±5 minutes</div>
|
| 368 |
+
<div class="text-xs text-gray-400">0/300 points</div>
|
| 369 |
+
</div>
|
| 370 |
+
</div>
|
| 371 |
+
<div class="flex items-start">
|
| 372 |
+
<div class="w-5 h-5 rounded-full bg-gray-600 flex items-center justify-center mr-2 mt-0.5">
|
| 373 |
+
<i class="fas fa-clock text-xs text-white"></i>
|
| 374 |
+
</div>
|
| 375 |
+
<div>
|
| 376 |
+
<div class="text-sm">Complete journey to Mumbai</div>
|
| 377 |
+
<div class="text-xs text-gray-400">0/1000 points</div>
|
| 378 |
+
</div>
|
| 379 |
+
</div>
|
| 380 |
+
<div class="flex items-start">
|
| 381 |
+
<div class="w-5 h-5 rounded-full bg-gray-600 flex items-center justify-center mr-2 mt-0.5">
|
| 382 |
+
<i class="fas fa-clock text-xs text-white"></i>
|
| 383 |
+
</div>
|
| 384 |
+
<div>
|
| 385 |
+
<div class="text-sm">Keep passenger satisfaction >80%</div>
|
| 386 |
+
<div class="text-xs text-gray-400">0/400 points</div>
|
| 387 |
+
</div>
|
| 388 |
+
</div>
|
| 389 |
+
</div>
|
| 390 |
+
</div>
|
| 391 |
+
|
| 392 |
+
<div class="cabin-panel p-4">
|
| 393 |
+
<h2 class="text-lg font-semibold mb-3 text-center border-b border-gray-600 pb-2">ENVIRONMENT</h2>
|
| 394 |
+
<div class="grid grid-cols-3 gap-2 mb-3">
|
| 395 |
+
<button class="bg-blue-800 hover:bg-blue-700 py-2 rounded" id="weather-clear">
|
| 396 |
+
<i class="fas fa-sun"></i>
|
| 397 |
+
<div class="text-xs mt-1">CLEAR</div>
|
| 398 |
+
</button>
|
| 399 |
+
<button class="bg-gray-700 hover:bg-gray-600 py-2 rounded" id="weather-fog">
|
| 400 |
+
<i class="fas fa-smog"></i>
|
| 401 |
+
<div class="text-xs mt-1">FOG</div>
|
| 402 |
+
</button>
|
| 403 |
+
<button class="bg-indigo-800 hover:bg-indigo-700 py-2 rounded" id="weather-rain">
|
| 404 |
+
<i class="fas fa-cloud-rain"></i>
|
| 405 |
+
<div class="text-xs mt-1">RAIN</div>
|
| 406 |
+
</button>
|
| 407 |
+
</div>
|
| 408 |
+
<div class="flex justify-between items-center">
|
| 409 |
+
<div>
|
| 410 |
+
<div class="text-sm">TIME OF DAY</div>
|
| 411 |
+
<div class="text-xs text-gray-400" id="time-display">10:42 AM</div>
|
| 412 |
+
</div>
|
| 413 |
+
<input type="range" min="0" max="1439" value="642" class="w-32 h-1 bg-gray-700 rounded-lg appearance-none cursor-pointer" id="time-slider">
|
| 414 |
+
</div>
|
| 415 |
+
</div>
|
| 416 |
+
</div>
|
| 417 |
+
</main>
|
| 418 |
+
|
| 419 |
+
<!-- Bottom Status Bar -->
|
| 420 |
+
<footer class="bg-gray-800 py-1 px-4 flex justify-between items-center text-sm border-t border-gray-700">
|
| 421 |
+
<div class="flex items-center space-x-4">
|
| 422 |
+
<div class="flex items-center">
|
| 423 |
+
<div class="w-3 h-3 rounded-full bg-green-500 mr-2"></div>
|
| 424 |
+
<span>POWER: ON</span>
|
| 425 |
+
</div>
|
| 426 |
+
<div class="flex items-center">
|
| 427 |
+
<div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
|
| 428 |
+
<span>PANTO: DOWN</span>
|
| 429 |
+
</div>
|
| 430 |
+
<div class="flex items-center">
|
| 431 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
|
| 432 |
+
<span>DOORS: LOCKED</span>
|
| 433 |
+
</div>
|
| 434 |
+
</div>
|
| 435 |
+
<div class="flex items-center space-x-4">
|
| 436 |
+
<div class="flex items-center">
|
| 437 |
+
<i class="fas fa-map-marker-alt text-red-400 mr-2"></i>
|
| 438 |
+
<span>KM 342.7 • BPL 148.3 km</span>
|
| 439 |
+
</div>
|
| 440 |
+
<div class="flex items-center">
|
| 441 |
+
<i class="fas fa-clock text-blue-400 mr-2"></i>
|
| 442 |
+
<span>DELAY: +3 min</span>
|
| 443 |
+
</div>
|
| 444 |
+
</div>
|
| 445 |
+
</footer>
|
| 446 |
+
|
| 447 |
+
<script>
|
| 448 |
+
// Game state
|
| 449 |
+
const gameState = {
|
| 450 |
+
speed: 0,
|
| 451 |
+
throttle: 0,
|
| 452 |
+
brake: 0,
|
| 453 |
+
power: 0,
|
| 454 |
+
pantograph: false,
|
| 455 |
+
headlights: false,
|
| 456 |
+
doors: false,
|
| 457 |
+
weather: 'clear',
|
| 458 |
+
time: 642, // 10:42 AM in minutes
|
| 459 |
+
signal: 'red',
|
| 460 |
+
score: 12450,
|
| 461 |
+
announcements: [
|
| 462 |
+
"Attention please! Train number 12952 Rajdhani Express arriving shortly on platform number 3.",
|
| 463 |
+
"Passengers are requested to board the train only after it comes to a complete halt.",
|
| 464 |
+
"Please keep your belongings safe and secure during the journey.",
|
| 465 |
+
"The next station is Bhopal Junction. We will arrive in approximately 2 hours.",
|
| 466 |
+
"Lunch will be served shortly in all AC coaches. Please contact your coach attendant.",
|
| 467 |
+
"This is a non-smoking train. Smoking is strictly prohibited.",
|
| 468 |
+
"Passengers are requested to cooperate with railway staff for a comfortable journey."
|
| 469 |
+
],
|
| 470 |
+
currentAnnouncement: 0
|
| 471 |
+
};
|
| 472 |
+
|
| 473 |
+
// DOM elements
|
| 474 |
+
const elements = {
|
| 475 |
+
throttle: document.getElementById('throttle'),
|
| 476 |
+
throttleValue: document.getElementById('throttle-value'),
|
| 477 |
+
brake: document.getElementById('brake'),
|
| 478 |
+
brakeValue: document.getElementById('brake-value'),
|
| 479 |
+
horn: document.getElementById('horn'),
|
| 480 |
+
headlight: document.getElementById('headlight'),
|
| 481 |
+
pantograph: document.getElementById('pantograph'),
|
| 482 |
+
doors: document.getElementById('doors'),
|
| 483 |
+
emergency: document.getElementById('emergency'),
|
| 484 |
+
speedValue: document.getElementById('speed-value'),
|
| 485 |
+
speedBar: document.getElementById('speed-bar'),
|
| 486 |
+
powerValue: document.getElementById('power-value'),
|
| 487 |
+
powerBar: document.getElementById('power-bar'),
|
| 488 |
+
weatherEffects: document.getElementById('weather-effects'),
|
| 489 |
+
weatherClear: document.getElementById('weather-clear'),
|
| 490 |
+
weatherFog: document.getElementById('weather-fog'),
|
| 491 |
+
weatherRain: document.getElementById('weather-rain'),
|
| 492 |
+
timeSlider: document.getElementById('time-slider'),
|
| 493 |
+
timeDisplay: document.getElementById('time-display'),
|
| 494 |
+
score: document.getElementById('score'),
|
| 495 |
+
announcementText: document.querySelector('.announcement-text')
|
| 496 |
+
};
|
| 497 |
+
|
| 498 |
+
// Initialize canvas
|
| 499 |
+
const canvas = document.getElementById('gameCanvas');
|
| 500 |
+
const ctx = canvas.getContext('2d');
|
| 501 |
+
|
| 502 |
+
function resizeCanvas() {
|
| 503 |
+
canvas.width = canvas.offsetWidth;
|
| 504 |
+
canvas.height = canvas.offsetHeight;
|
| 505 |
+
renderScene();
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
window.addEventListener('resize', resizeCanvas);
|
| 509 |
+
resizeCanvas();
|
| 510 |
+
|
| 511 |
+
// Event listeners for controls
|
| 512 |
+
elements.throttle.addEventListener('input', function() {
|
| 513 |
+
gameState.throttle = parseInt(this.value);
|
| 514 |
+
elements.throttleValue.textContent = `${gameState.throttle}%`;
|
| 515 |
+
updatePower();
|
| 516 |
+
});
|
| 517 |
+
|
| 518 |
+
elements.brake.addEventListener('input', function() {
|
| 519 |
+
gameState.brake = parseInt(this.value);
|
| 520 |
+
elements.brakeValue.textContent = `${gameState.brake}%`;
|
| 521 |
+
updateSpeed();
|
| 522 |
+
});
|
| 523 |
+
|
| 524 |
+
elements.horn.addEventListener('click', function() {
|
| 525 |
+
playHornSound();
|
| 526 |
+
// Visual feedback
|
| 527 |
+
this.classList.add('bg-blue-600');
|
| 528 |
+
setTimeout(() => {
|
| 529 |
+
this.classList.remove('bg-blue-600');
|
| 530 |
+
}, 200);
|
| 531 |
+
});
|
| 532 |
+
|
| 533 |
+
elements.headlight.addEventListener('click', function() {
|
| 534 |
+
gameState.headlights = !gameState.headlights;
|
| 535 |
+
this.classList.toggle('bg-gray-600');
|
| 536 |
+
this.classList.toggle('bg-blue-600');
|
| 537 |
+
renderScene();
|
| 538 |
+
});
|
| 539 |
+
|
| 540 |
+
elements.pantograph.addEventListener('click', function() {
|
| 541 |
+
gameState.pantograph = !gameState.pantograph;
|
| 542 |
+
this.classList.toggle('bg-green-600');
|
| 543 |
+
this.classList.toggle('bg-gray-600');
|
| 544 |
+
updatePower();
|
| 545 |
+
});
|
| 546 |
+
|
| 547 |
+
elements.doors.addEventListener('click', function() {
|
| 548 |
+
gameState.doors = !gameState.doors;
|
| 549 |
+
this.classList.toggle('bg-purple-600');
|
| 550 |
+
this.classList.toggle('bg-gray-600');
|
| 551 |
+
});
|
| 552 |
+
|
| 553 |
+
elements.emergency.addEventListener('click', function() {
|
| 554 |
+
gameState.brake = 100;
|
| 555 |
+
elements.brake.value = 100;
|
| 556 |
+
elements.brakeValue.textContent = '100%';
|
| 557 |
+
updateSpeed();
|
| 558 |
+
|
| 559 |
+
// Visual feedback
|
| 560 |
+
this.classList.add('bg-red-800');
|
| 561 |
+
setTimeout(() => {
|
| 562 |
+
this.classList.remove('bg-red-800');
|
| 563 |
+
}, 1000);
|
| 564 |
+
});
|
| 565 |
+
|
| 566 |
+
elements.weatherClear.addEventListener('click', function() {
|
| 567 |
+
gameState.weather = 'clear';
|
| 568 |
+
updateWeather();
|
| 569 |
+
});
|
| 570 |
+
|
| 571 |
+
elements.weatherFog.addEventListener('click', function() {
|
| 572 |
+
gameState.weather = 'fog';
|
| 573 |
+
updateWeather();
|
| 574 |
+
});
|
| 575 |
+
|
| 576 |
+
elements.weatherRain.addEventListener('click', function() {
|
| 577 |
+
gameState.weather = 'rain';
|
| 578 |
+
updateWeather();
|
| 579 |
+
});
|
| 580 |
+
|
| 581 |
+
elements.timeSlider.addEventListener('input', function() {
|
| 582 |
+
gameState.time = parseInt(this.value);
|
| 583 |
+
updateTimeDisplay();
|
| 584 |
+
renderScene();
|
| 585 |
+
});
|
| 586 |
+
|
| 587 |
+
// Game logic functions
|
| 588 |
+
function updatePower() {
|
| 589 |
+
if (gameState.pantograph) {
|
| 590 |
+
gameState.power = Math.floor(gameState.throttle * 0.9 - gameState.brake * 0.2);
|
| 591 |
+
if (gameState.power < 0) gameState.power = 0;
|
| 592 |
+
} else {
|
| 593 |
+
gameState.power = 0;
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
elements.powerValue.textContent = `${gameState.power}%`;
|
| 597 |
+
elements.powerBar.style.width = `${gameState.power}%`;
|
| 598 |
+
|
| 599 |
+
updateSpeed();
|
| 600 |
+
}
|
| 601 |
+
|
| 602 |
+
function updateSpeed() {
|
| 603 |
+
// Simplified physics - in a real game this would be more complex
|
| 604 |
+
const acceleration = gameState.power * 0.02;
|
| 605 |
+
const deceleration = gameState.brake * 0.05 + 0.1; // Base friction + brake
|
| 606 |
+
|
| 607 |
+
gameState.speed += acceleration - deceleration;
|
| 608 |
+
if (gameState.speed < 0) gameState.speed = 0;
|
| 609 |
+
if (gameState.speed > 110) gameState.speed = 110; // Speed limit
|
| 610 |
+
|
| 611 |
+
elements.speedValue.textContent = `${Math.round(gameState.speed)} km/h`;
|
| 612 |
+
elements.speedBar.style.width = `${(gameState.speed / 110) * 100}%`;
|
| 613 |
+
|
| 614 |
+
// Update score based on speed (simplified)
|
| 615 |
+
if (gameState.speed > 0) {
|
| 616 |
+
gameState.score += Math.floor(gameState.speed / 10);
|
| 617 |
+
elements.score.textContent = gameState.score.toLocaleString();
|
| 618 |
+
}
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
function updateWeather() {
|
| 622 |
+
elements.weatherEffects.innerHTML = '';
|
| 623 |
+
|
| 624 |
+
switch (gameState.weather) {
|
| 625 |
+
case 'fog':
|
| 626 |
+
const fog = document.createElement('div');
|
| 627 |
+
fog.className = 'fog-effect';
|
| 628 |
+
elements.weatherEffects.appendChild(fog);
|
| 629 |
+
break;
|
| 630 |
+
case 'rain':
|
| 631 |
+
const rain = document.createElement('div');
|
| 632 |
+
rain.className = 'rain-effect';
|
| 633 |
+
elements.weatherEffects.appendChild(rain);
|
| 634 |
+
break;
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
// Update button states
|
| 638 |
+
elements.weatherClear.classList.remove('bg-blue-700', 'bg-blue-800');
|
| 639 |
+
elements.weatherFog.classList.remove('bg-gray-700', 'bg-gray-800');
|
| 640 |
+
elements.weatherRain.classList.remove('bg-indigo-700', 'bg-indigo-800');
|
| 641 |
+
|
| 642 |
+
if (gameState.weather === 'clear') {
|
| 643 |
+
elements.weatherClear.classList.add('bg-blue-700');
|
| 644 |
+
} else {
|
| 645 |
+
elements.weatherClear.classList.add('bg-blue-800');
|
| 646 |
+
}
|
| 647 |
+
|
| 648 |
+
if (gameState.weather === 'fog') {
|
| 649 |
+
elements.weatherFog.classList.add('bg-gray-700');
|
| 650 |
+
} else {
|
| 651 |
+
elements.weatherFog.classList.add('bg-gray-800');
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
if (gameState.weather === 'rain') {
|
| 655 |
+
elements.weatherRain.classList.add('bg-indigo-700');
|
| 656 |
+
} else {
|
| 657 |
+
elements.weatherRain.classList.add('bg-indigo-800');
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
renderScene();
|
| 661 |
+
}
|
| 662 |
+
|
| 663 |
+
function updateTimeDisplay() {
|
| 664 |
+
const hours = Math.floor(gameState.time / 60);
|
| 665 |
+
const minutes = gameState.time % 60;
|
| 666 |
+
const ampm = hours >= 12 ? 'PM' : 'AM';
|
| 667 |
+
const displayHours = hours % 12 || 12;
|
| 668 |
+
|
| 669 |
+
elements.timeDisplay.textContent =
|
| 670 |
+
`${displayHours}:${minutes.toString().padStart(2, '0')} ${ampm}`;
|
| 671 |
+
}
|
| 672 |
+
|
| 673 |
+
function playHornSound() {
|
| 674 |
+
// In a real implementation, we would play an actual sound
|
| 675 |
+
console.log("Horn sound played!");
|
| 676 |
+
}
|
| 677 |
+
|
| 678 |
+
function cycleAnnouncements() {
|
| 679 |
+
elements.announcementText.textContent = gameState.announcements[gameState.currentAnnouncement];
|
| 680 |
+
gameState.currentAnnouncement = (gameState.currentAnnouncement + 1) % gameState.announcements.length;
|
| 681 |
+
|
| 682 |
+
// Random interval between announcements (15-45 seconds)
|
| 683 |
+
setTimeout(cycleAnnouncements, 15000 + Math.random() * 30000);
|
| 684 |
+
}
|
| 685 |
+
|
| 686 |
+
// Render the 3D scene (simplified 2D representation)
|
| 687 |
+
function renderScene() {
|
| 688 |
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 689 |
+
|
| 690 |
+
// Background based on time of day
|
| 691 |
+
const hour = gameState.time / 60;
|
| 692 |
+
let bgColor;
|
| 693 |
+
|
| 694 |
+
if (hour < 5 || hour >= 19) {
|
| 695 |
+
// Night
|
| 696 |
+
bgColor = '#0f172a';
|
| 697 |
+
} else if (hour < 6 || hour >= 18) {
|
| 698 |
+
// Dawn/Dusk
|
| 699 |
+
bgColor = '#1e40af';
|
| 700 |
+
} else {
|
| 701 |
+
// Day
|
| 702 |
+
bgColor = '#38bdf8';
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
ctx.fillStyle = bgColor;
|
| 706 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| 707 |
+
|
| 708 |
+
// Draw horizon
|
| 709 |
+
ctx.fillStyle = hour < 6 || hour >= 18 ? '#1e293b' : '#475569';
|
| 710 |
+
ctx.fillRect(0, canvas.height * 0.7, canvas.width, canvas.height * 0.3);
|
| 711 |
+
|
| 712 |
+
// Draw tracks
|
| 713 |
+
ctx.fillStyle = '#4b5563';
|
| 714 |
+
ctx.fillRect(0, canvas.height * 0.8, canvas.width, 10);
|
| 715 |
+
|
| 716 |
+
// Draw sleepers
|
| 717 |
+
ctx.fillStyle = '#6b7280';
|
| 718 |
+
for (let x = 0; x < canvas.width; x += 40) {
|
| 719 |
+
ctx.fillRect(x, canvas.height * 0.8 - 5, 30, 5);
|
| 720 |
+
}
|
| 721 |
+
|
| 722 |
+
// Draw platform if at station
|
| 723 |
+
if (gameState.speed === 0) {
|
| 724 |
+
ctx.fillStyle = '#9ca3af';
|
| 725 |
+
ctx.fillRect(0, canvas.height * 0.7 - 20, canvas.width, 20);
|
| 726 |
+
|
| 727 |
+
// Platform tiles
|
| 728 |
+
ctx.fillStyle = '#d1d5db';
|
| 729 |
+
for (let x = 0; x < canvas.width; x += 40) {
|
| 730 |
+
ctx.fillRect(x, canvas.height * 0.7 - 20, 20, 20);
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
// Draw passengers
|
| 734 |
+
for (let i = 0; i < 5; i++) {
|
| 735 |
+
const x = Math.random() * canvas.width;
|
| 736 |
+
const y = canvas.height * 0.7 - 25;
|
| 737 |
+
drawPassenger(x, y);
|
| 738 |
+
}
|
| 739 |
+
}
|
| 740 |
+
|
| 741 |
+
// Draw train
|
| 742 |
+
drawTrain();
|
| 743 |
+
|
| 744 |
+
// Draw signals
|
| 745 |
+
drawSignal(canvas.width * 0.8, canvas.height * 0.6);
|
| 746 |
+
|
| 747 |
+
// Draw scenery elements
|
| 748 |
+
if (gameState.speed > 0) {
|
| 749 |
+
// Moving scenery
|
| 750 |
+
for (let i = 0; i < 3; i++) {
|
| 751 |
+
const x = Math.random() * canvas.width;
|
| 752 |
+
const y = canvas.height * 0.6;
|
| 753 |
+
drawSceneryElement(x, y);
|
| 754 |
+
}
|
| 755 |
+
}
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
function drawTrain() {
|
| 759 |
+
const trainLength = 200 + (gameState.speed / 10);
|
| 760 |
+
const trainX = canvas.width * 0.2;
|
| 761 |
+
const trainY = canvas.height * 0.7 - 50;
|
| 762 |
+
|
| 763 |
+
// Locomotive
|
| 764 |
+
ctx.fillStyle = '#d10a11';
|
| 765 |
+
ctx.fillRect(trainX, trainY, 80, 50);
|
| 766 |
+
ctx.fillStyle = 'white';
|
| 767 |
+
ctx.fillRect(trainX + 48, trainY, 32, 50);
|
| 768 |
+
|
| 769 |
+
// Windows
|
| 770 |
+
ctx.fillStyle = '#1e293b';
|
| 771 |
+
for (let i = 0; i < 3; i++) {
|
| 772 |
+
ctx.fillRect(trainX + 10 + i * 20, trainY + 10, 15, 15);
|
| 773 |
+
}
|
| 774 |
+
|
| 775 |
+
// Headlight if on
|
| 776 |
+
if (gameState.headlights) {
|
| 777 |
+
ctx.fillStyle = 'rgba(255, 255, 255, 0.7)';
|
| 778 |
+
ctx.beginPath();
|
| 779 |
+
ctx.moveTo(trainX + 80, trainY + 25);
|
| 780 |
+
ctx.lineTo(trainX + 120, trainY + 10);
|
| 781 |
+
ctx.lineTo(trainX + 120, trainY + 40);
|
| 782 |
+
ctx.closePath();
|
| 783 |
+
ctx.fill();
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
// Coaches
|
| 787 |
+
for (let i = 0; i < 5; i++) {
|
| 788 |
+
ctx.fillStyle = '#003580';
|
| 789 |
+
ctx.fillRect(trainX + 80 + i * 40, trainY, 40, 50);
|
| 790 |
+
ctx.fillStyle = 'white';
|
| 791 |
+
ctx.fillRect(trainX + 80 + i * 40 + 24, trainY, 16, 50);
|
| 792 |
+
|
| 793 |
+
// Windows
|
| 794 |
+
ctx.fillStyle = '#1e293b';
|
| 795 |
+
for (let j = 0; j < 2; j++) {
|
| 796 |
+
ctx.fillRect(trainX + 80 + i * 40 + 5 + j * 15, trainY + 10, 10, 15);
|
| 797 |
+
}
|
| 798 |
+
|
| 799 |
+
// Coach number
|
| 800 |
+
ctx.fillStyle = 'white';
|
| 801 |
+
ctx.font = '10px Arial';
|
| 802 |
+
ctx.fillText(`S${i+1}`, trainX + 80 + i * 40 + 15, trainY + 40);
|
| 803 |
+
}
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
function drawSignal(x, y) {
|
| 807 |
+
// Post
|
| 808 |
+
ctx.fillStyle = '#57534e';
|
| 809 |
+
ctx.fillRect(x, y, 10, 100);
|
| 810 |
+
|
| 811 |
+
// Housing
|
| 812 |
+
ctx.fillStyle = '#1e293b';
|
| 813 |
+
ctx.fillRect(x - 15, y - 30, 40, 30);
|
| 814 |
+
|
| 815 |
+
// Lights
|
| 816 |
+
const colors = {
|
| 817 |
+
red: gameState.signal === 'red' ? '#ef4444' : '#450a0a',
|
| 818 |
+
yellow: gameState.signal === 'yellow' ? '#eab308' : '#422006',
|
| 819 |
+
green: gameState.signal === 'green' ? '#22c55e' : '#052e16'
|
| 820 |
+
};
|
| 821 |
+
|
| 822 |
+
ctx.beginPath();
|
| 823 |
+
ctx.arc(x + 5, y - 20, 5, 0, Math.PI * 2);
|
| 824 |
+
ctx.fillStyle = colors.red;
|
| 825 |
+
ctx.fill();
|
| 826 |
+
|
| 827 |
+
ctx.beginPath();
|
| 828 |
+
ctx.arc(x + 5, y - 10, 5, 0, Math.PI * 2);
|
| 829 |
+
ctx.fillStyle = colors.yellow;
|
| 830 |
+
ctx.fill();
|
| 831 |
+
|
| 832 |
+
ctx.beginPath();
|
| 833 |
+
ctx.arc(x + 5, y, 5, 0, Math.PI * 2);
|
| 834 |
+
ctx.fillStyle = colors.green;
|
| 835 |
+
ctx.fill();
|
| 836 |
+
}
|
| 837 |
+
|
| 838 |
+
function drawPassenger(x, y) {
|
| 839 |
+
// Head
|
| 840 |
+
ctx.beginPath();
|
| 841 |
+
ctx.arc(x, y, 5, 0, Math.PI * 2);
|
| 842 |
+
ctx.fillStyle = '#f59e0b';
|
| 843 |
+
ctx.fill();
|
| 844 |
+
|
| 845 |
+
// Body
|
| 846 |
+
ctx.fillStyle = '#4b5563';
|
| 847 |
+
ctx.fillRect(x - 5, y + 5, 10, 15);
|
| 848 |
+
|
| 849 |
+
// Legs
|
| 850 |
+
ctx.fillRect(x - 5, y + 20, 4, 10);
|
| 851 |
+
ctx.fillRect(x + 1, y + 20, 4, 10);
|
| 852 |
+
}
|
| 853 |
+
|
| 854 |
+
function drawSceneryElement(x, y) {
|
| 855 |
+
const types = ['tree', 'building', 'cow'];
|
| 856 |
+
const type = types[Math.floor(Math.random() * types.length)];
|
| 857 |
+
|
| 858 |
+
switch (type) {
|
| 859 |
+
case 'tree':
|
| 860 |
+
// Trunk
|
| 861 |
+
ctx.fillStyle = '#78350f';
|
| 862 |
+
ctx.fillRect(x, y, 5, 20);
|
| 863 |
+
|
| 864 |
+
// Leaves
|
| 865 |
+
ctx.beginPath();
|
| 866 |
+
ctx.arc(x + 2, y - 10, 15, 0, Math.PI * 2);
|
| 867 |
+
ctx.fillStyle = '#166534';
|
| 868 |
+
ctx.fill();
|
| 869 |
+
break;
|
| 870 |
+
|
| 871 |
+
case 'building':
|
| 872 |
+
ctx.fillStyle = '#475569';
|
| 873 |
+
const height = 30 + Math.random() * 30;
|
| 874 |
+
const width = 20 + Math.random() * 20;
|
| 875 |
+
ctx.fillRect(x, y - height, width, height);
|
| 876 |
+
|
| 877 |
+
// Windows
|
| 878 |
+
ctx.fillStyle = '#fef08a';
|
| 879 |
+
for (let i = 0; i < 2; i++) {
|
| 880 |
+
for (let j = 0; j < 2; j++) {
|
| 881 |
+
if (Math.random() > 0.3) {
|
| 882 |
+
ctx.fillRect(x + 5 + i * 8, y - height + 5 + j * 8, 5, 5);
|
| 883 |
+
}
|
| 884 |
+
}
|
| 885 |
+
}
|
| 886 |
+
break;
|
| 887 |
+
|
| 888 |
+
case 'cow':
|
| 889 |
+
// Body
|
| 890 |
+
ctx.beginPath();
|
| 891 |
+
ctx.ellipse(x, y, 10, 5, 0, 0, Math.PI * 2);
|
| 892 |
+
ctx.fillStyle = '#6b7280';
|
| 893 |
+
ctx.fill();
|
| 894 |
+
|
| 895 |
+
// Head
|
| 896 |
+
ctx.beginPath();
|
| 897 |
+
ctx.arc(x - 12, y - 3, 4, 0, Math.PI * 2);
|
| 898 |
+
ctx.fillStyle = '#6b7280';
|
| 899 |
+
ctx.fill();
|
| 900 |
+
|
| 901 |
+
// Spots
|
| 902 |
+
ctx.beginPath();
|
| 903 |
+
ctx.arc(x + 2, y - 2, 3, 0, Math.PI * 2);
|
| 904 |
+
ctx.fillStyle = '#9ca3af';
|
| 905 |
+
ctx.fill();
|
| 906 |
+
break;
|
| 907 |
+
}
|
| 908 |
+
}
|
| 909 |
+
|
| 910 |
+
// Game loop
|
| 911 |
+
function gameLoop() {
|
| 912 |
+
updateSpeed();
|
| 913 |
+
renderScene();
|
| 914 |
+
|
| 915 |
+
// Random signal changes
|
| 916 |
+
if (Math.random() < 0.005) {
|
| 917 |
+
const signals = ['red', 'yellow', 'green'];
|
| 918 |
+
gameState.signal = signals[Math.floor(Math.random() * signals.length)];
|
| 919 |
+
}
|
| 920 |
+
|
| 921 |
+
requestAnimationFrame(gameLoop);
|
| 922 |
+
}
|
| 923 |
+
|
| 924 |
+
// Initialize game
|
| 925 |
+
updateWeather();
|
| 926 |
+
updateTimeDisplay();
|
| 927 |
+
cycleAnnouncements();
|
| 928 |
+
gameLoop();
|
| 929 |
+
|
| 930 |
+
// Simulate random AI train horns
|
| 931 |
+
setInterval(() => {
|
| 932 |
+
if (Math.random() > 0.7) {
|
| 933 |
+
playHornSound();
|
| 934 |
+
}
|
| 935 |
+
}, 10000 + Math.random() * 20000);
|
| 936 |
+
</script>
|
| 937 |
+
<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=div988/train" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 938 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
"Develop a realistic 3D Indian train simulator inspired by Microsoft Train Simulator. The game should feature: An Indian Railways WAP-7 electric locomotive with red and white livery, detailed cabin controls (throttle, brake, horn, headlights, pantograph switch). Passenger coaches modeled after LHB and ICF designs, labeled 'S1', 'S2', etc., with authentic blue and white color schemes. Major Indian railway stations like New Delhi, Mumbai CST, and Chennai Central, complete with bilingual signage, tiled platforms, station vendors, and footbridges. Realistic Indian environments including rural fields, urban crossings with auto-rickshaws, pedestrians, and background elements like cows and street banners. Dynamic weather conditions such as monsoon rain and dense morning fog, along with a day-night cycle. Sound effects including Indian station announcements, train horns, and ambient noises. Gameplay mechanics involving train operation, adherence to signals, scheduled stops, and a scoring system based on punctuality and passenger satisfaction. A career mode starting as an assistant loco pilot progressing to higher ranks. AI-controlled trains passing by with random horn sounds."
|