Current directory: /home/klas4s23/domains/585455.klas4s23.mid-ica.nl/public_html/Gastenboek/uploads
// ========================================
// ===== DRIVE MY PORTFOLIO - MAIN ========
// ========================================
// This is the entry point for the game.
// It uses a modular ES6 class architecture.
// All game systems are organized into separate
// classes for better maintainability.
// ========================================
import { Game } from './src/classes/Game.js';
// Initialize the game when DOM is ready
let game;
function init() {
try {
game = new Game();
console.log('🚗 Drive My Portfolio - Game initialized!');
console.log('Controls: WASD/Arrows to drive, Space to brake, E to interact, L for headlights');
console.log('Shortcuts: N to toggle day/night, H to toggle HUD');
} catch (error) {
console.error('Failed to initialize game:', error);
}
}
// Start when page loads
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
// Cleanup on page unload
window.addEventListener('beforeunload', () => {
if (game) {
game.dispose();
}
});
// Export for debugging
window.game = game;