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

@@ -75,3 +75,57 @@ body {
background-color: #000;
cursor: crosshair;
}
#player-hud {
position: fixed;
bottom: 10px;
left: 10px;
width: 300px;
background-color: rgba(0, 0, 0, 0.7);
color: white;
padding: 10px;
border-radius: 5px;
font-family: Arial, sans-serif;
z-index: 1000;
}
#health-bar-container {
width: 100%;
height: 20px;
background-color: rgba(255, 255, 255, 0.3);
margin-bottom: 10px;
border-radius: 3px;
}
#health-bar {
width: 100%;
height: 100%;
background-color: #4CAF50;
border-radius: 3px;
transition: width 0.3s;
}
#inventory-container {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 5px;
}
.inventory-slot {
width: 30px;
height: 30px;
background-color: rgba(255, 255, 255, 0.2);
border-radius: 3px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 10px;
position: relative;
transition: transform 0.1s;
}
.inventory-slot:hover {
transform: scale(1.1);
background-color: rgba(255, 255, 255, 0.3);
}