Coins: 0/12
Time Vault Explorer
WASD - Move around
Mouse - Look around
E - Interact with objects
TAB - Toggle collection view
R - Return to Hub
WASD - Move around
Mouse - Look around
E - Interact with objects
TAB - Toggle collection view
R - Return to Hub
Coin Collection
Time Vault Laboratory
${subtitle}`; eraTitle.style.display = 'block'; setTimeout(() => { eraTitle.style.display = 'none'; }, 3000); }toggleCoinInfo() { const coinInfo = document.getElementById('coinInfo'); if (coinInfo.style.display === 'none' || !coinInfo.style.display) { this.updateCoinList(); coinInfo.style.display = 'block'; } else { coinInfo.style.display = 'none'; } }updateCoinList() { const coinList = document.getElementById('coinList'); const collectedCoins = this.game.getCollectedCoins(); coinList.innerHTML = ''; collectedCoins.forEach(coin => { const entry = document.createElement('div'); entry.className = 'coin-entry'; entry.innerHTML = `
${coin.name}
Date: ${coin.date}
Mint: ${coin.mint}
Value: ${coin.value}
Context: ${coin.context}
`;
coinList.appendChild(entry);
});if (collectedCoins.length === 0) {
coinList.innerHTML = 'Mint: ${coin.mint}
Value: ${coin.value}
Context: ${coin.context}
No coins collected yet. Explore to find historical treasures!
';
}
}animate() {
requestAnimationFrame(() => this.animate());
const deltaTime = this.clock.getDelta();
// Update player controller
const cameraRotation = this.cameraController.update();
this.playerController.update(deltaTime, cameraRotation);
// Update game systems
this.game.update(deltaTime);
// Update UI
document.getElementById('coinCounter').textContent =
`Coins: ${this.game.collectedCoins.length}/${this.game.totalCoins}`;
// Render
this.renderer.render(this.scene, this.camera);
}onWindowResize() {
this.camera.aspect = window.innerWidth / window.innerHeight;
this.camera.updateProjectionMatrix();
this.renderer.setSize(window.innerWidth, window.innerHeight);
}
}// Start the game
new GameManager();
]]>