feat: Add block breaking, HUD, and inventory system for player
This commit is contained in:
16
js/main.js
16
js/main.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user