feat: Add block breaking, HUD, and inventory system for player

This commit is contained in:
Kacper Kostka (aider)
2025-04-05 19:08:28 +02:00
parent 755be2f5a4
commit d765defa9d
5 changed files with 365 additions and 1 deletions

View File

@@ -115,6 +115,22 @@ function spawnPlayer() {
// Remove the event listener for the spawn button to prevent multiple spawns
document.getElementById('spawn-player-btn').removeEventListener('click', spawnPlayer);
// Create CSS for player HUD
const style = document.createElement('style');
style.textContent = `
#player-hud {
transition: opacity 0.3s;
}
.inventory-slot {
transition: transform 0.1s;
}
.inventory-slot:hover {
transform: scale(1.1);
background-color: rgba(255, 255, 255, 0.3) !important;
}
`;
document.head.appendChild(style);
}
function simulationLoop(timestamp) {