'New Orleans - The French Quarter', 'lat' => 29.9584, 'lon' => -90.0644, 'description' => 'Start your journey in the heart of jazz and Creole culture. The French Quarter\'s wrought-iron balconies and lively streets set the scene for adventure.', 'image' => 'images/crescent1.jpg'], ['name' => 'Slidell - Gateway to Bayou Country', 'lat' => 30.2752, 'lon' => -89.7812, 'description' => 'Cross into the mysterious bayous of Louisiana, where cypress trees draped in Spanish moss guard ancient secrets.', 'image' => 'images/crescent2.jpg'], ['name' => 'Hattiesburg - Hub City', 'lat' => 31.3271, 'lon' => -89.2903, 'description' => 'A railroad town since 1884, Hattiesburg earned its nickname as the crossroads of Southern Mississippi.', 'image' => 'images/crescent3.jpg'], ['name' => 'Meridian - Queen City', 'lat' => 32.3643, 'lon' => -88.7037, 'description' => 'Once the largest city in Mississippi, Meridian was a vital railroad junction during the Civil War era.', 'image' => 'images/crescent4.jpg'], ['name' => 'Birmingham - Magic City', 'lat' => 33.5186, 'lon' => -86.8104, 'description' => 'The industrial heart of the South, Birmingham rose from iron and steel to become a symbol of civil rights progress.', 'image' => 'images/crescent5.jpg'], ['name' => 'Atlanta - The Phoenix City', 'lat' => 33.7490, 'lon' => -84.3880, 'description' => 'Rising from the ashes of the Civil War, Atlanta stands as the cultural and economic capital of the New South.', 'image' => 'images/crescent6.jpg'], ['name' => 'Charlotte - Queen City of the South', 'lat' => 35.2271, 'lon' => -80.8431, 'description' => 'Named for Queen Charlotte, this banking hub blends Southern charm with modern ambition.', 'image' => 'images/crescent7.jpg'], ['name' => 'Charlottesville - Jefferson\'s Home', 'lat' => 38.0293, 'lon' => -78.4767, 'description' => 'In the shadow of Monticello, Thomas Jefferson\'s architectural masterpiece overlooks the Blue Ridge Mountains.', 'image' => 'images/crescent8.jpg'], ['name' => 'Washington D.C. - The Capital', 'lat' => 38.9072, 'lon' => -77.0369, 'description' => 'The nation\'s capital, where marble monuments and cherry blossoms line the National Mall.', 'image' => 'images/crescent9.jpg'], ['name' => 'New York - Penn Station', 'lat' => 40.7506, 'lon' => -73.9935, 'description' => 'Your journey ends at the busiest train station in North America, gateway to the city that never sleeps.', 'image' => 'images/crescent10.jpg'] ]; // Initialize player $playerId = $_COOKIE['crescent_id'] ?? ''; $playerName = $_COOKIE['crescent_name'] ?? ''; if (!$playerId) { $playerId = bin2hex(random_bytes(8)); setcookie('crescent_id', $playerId, time() + (86400 * 365), '/'); $adjectives = ['Swift', 'Lucky', 'Bold', 'Keen', 'Noble', 'Brave', 'Quick', 'Wise']; $nouns = ['Traveler', 'Explorer', 'Pioneer', 'Voyager', 'Wanderer', 'Seeker', 'Ranger', 'Scout']; $playerName = $adjectives[array_rand($adjectives)] . ' ' . $nouns[array_rand($nouns)]; setcookie('crescent_name', $playerName, time() + (86400 * 365), '/'); } // Load game state from file $gameFile = __DIR__ . '/crescent_data.json'; if (!file_exists($gameFile)) { file_put_contents($gameFile, json_encode(['players' => [], 'discoveries' => []])); } $gameData = json_decode(file_get_contents($gameFile), true); // Initialize player state if (!isset($gameData['players'][$playerId])) { $gameData['players'][$playerId] = [ 'lat' => 29.9584, 'lon' => -90.0644, 'bearing' => 45, 'speed' => 100, 'name' => $playerName, 'found' => [], 'last_update' => time() ]; } $player = &$gameData['players'][$playerId]; // Handle actions $action = $_GET['a'] ?? ''; $speedChange = intval($_GET['sc'] ?? 1); if ($action === 'L') { $player['bearing'] = ($player['bearing'] - 90 + 360) % 360; } elseif ($action === 'R') { $player['bearing'] = ($player['bearing'] + 90) % 360; } elseif ($action === 'A') { $player['speed'] = min($player['speed'] + (10 * $speedChange), 500); } elseif ($action === 'B') { $player['speed'] = max($player['speed'] - (10 * $speedChange), 0); } // Calculate movement based on elapsed time $elapsed = time() - $player['last_update']; if ($elapsed > 0 && $player['speed'] > 0) { $distanceKm = ($player['speed'] * $elapsed) / 3600; $bearingRad = deg2rad($player['bearing']); $latRad = deg2rad($player['lat']); $earthRadius = 6371; $newLat = asin(sin($latRad) * cos($distanceKm/$earthRadius) + cos($latRad) * sin($distanceKm/$earthRadius) * cos($bearingRad)); $newLon = deg2rad($player['lon']) + atan2( sin($bearingRad) * sin($distanceKm/$earthRadius) * cos($latRad), cos($distanceKm/$earthRadius) - sin($latRad) * sin($newLat) ); $player['lat'] = rad2deg($newLat); $player['lon'] = rad2deg($newLon); } $player['last_update'] = time(); // Check for treasure discoveries $newDiscovery = null; foreach ($treasures as $index => $treasure) { if (!in_array($index, $player['found'])) { $distance = sqrt(pow($player['lat'] - $treasure['lat'], 2) + pow($player['lon'] - $treasure['lon'], 2)) * 111; if ($distance < 50) { $player['found'][] = $index; $newDiscovery = $treasure; $gameData['discoveries'][] = [ 'player' => $playerName, 'treasure' => $treasure['name'], 'time' => time() ]; } } } // Save game state file_put_contents($gameFile, json_encode($gameData)); $directions = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']; $dirIndex = round($player['bearing'] / 45) % 8; $dirName = $directions[$dirIndex]; $progress = (count($player['found']) / count($treasures)) * 100; ?>
← Back to Game Selection

🚂 The Crescent

New Orleans to New York - Follow the historic Amtrak route through the American South

Position: °N, °W
Heading: ° ()
Speed: km/h
Progress: / stops (%)
← LEFT RIGHT → ↑ THROTTLE ↓ BRAKE

🎉 Stop Discovered!