added mining game

This commit is contained in:
2025-11-25 05:36:39 +11:00
parent c07bd6ea2c
commit 67261e3eac
617 changed files with 2614 additions and 10 deletions

259
src/mining.html Normal file
View File

@@ -0,0 +1,259 @@
<!--
METADATA:{
"title": "Prison Mine - Litruv",
"metaDescription": "Infinite isometric prison mining game.",
"csp": "script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net;",
"ogTitle": "Prison Mine - Litruv",
"ogDescription": "Dig deep in this infinite isometric mining game.",
"ogUrl": "https://lit.ruv.wtf/mining.html",
"twitterTitle": "Prison Mine - Litruv",
"twitterDescription": "Dig deep in this infinite isometric mining game.",
"twitterUrl": "https://lit.ruv.wtf/mining.html",
"useCommonHeader": true,
"useCommonFooter": true
}
-->
<!-- START_STYLES -->
<style>
.mining-container {
width: min(100%, 80vh);
aspect-ratio: 1;
margin: 0 auto;
position: relative;
overflow: hidden;
background: #000;
border: 2px solid var(--post-border);
box-shadow: 4px 6px 0 var(--shadow-light);
}
#game-canvas {
width: 100%;
height: 100%;
display: block;
}
.mining-ui {
position: absolute;
top: 10px;
left: 10px;
color: white;
font-family: 'Minecraft', monospace; /* Fallback */
pointer-events: none;
text-shadow: 2px 2px 0 #000;
z-index: 10;
}
.mining-stat {
font-size: 1.5rem;
margin-bottom: 0.5rem;
}
.inventory-container {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
display: flex;
gap: 5px;
background: rgba(0, 0, 0, 0.5);
padding: 5px;
border-radius: 5px;
pointer-events: auto;
}
.inventory-slot {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.1);
border: 2px solid #555;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.inventory-slot img {
width: 32px;
height: 32px;
image-rendering: pixelated;
}
.inventory-count {
position: absolute;
bottom: 0;
right: 2px;
font-size: 12px;
color: white;
text-shadow: 1px 1px 0 #000;
}
.crafting-container {
position: absolute;
top: 50%;
right: 10px;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 5px;
background: rgba(0, 0, 0, 0.5);
padding: 5px;
border-radius: 5px;
pointer-events: auto; /* Allow clicking */
}
.crafting-slot {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.1);
border: 2px solid #555;
position: relative;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.2s;
}
.crafting-slot:hover {
background: rgba(255, 255, 255, 0.2);
}
.crafting-slot.can-craft {
border-color: #79C05A;
background: rgba(121, 192, 90, 0.2);
}
.crafting-slot img {
width: 32px;
height: 32px;
image-rendering: pixelated;
}
.crafting-tooltip {
position: absolute;
right: 100%;
top: 50%;
transform: translateY(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 5px;
border-radius: 3px;
font-size: 12px;
white-space: nowrap;
display: none;
margin-right: 10px;
pointer-events: none;
z-index: 20;
}
.crafting-slot:hover .crafting-tooltip {
display: block;
}
.shop-btn {
position: absolute;
top: 10px;
right: 10px;
background: #4CAF50;
color: white;
border: 2px solid #388E3C;
padding: 5px 10px;
font-family: 'Minecraft', monospace;
cursor: pointer;
z-index: 20;
}
.shop-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 0.9);
border: 2px solid #555;
padding: 20px;
color: white;
font-family: 'Minecraft', monospace;
display: none;
z-index: 30;
min-width: 300px;
}
.shop-section {
margin-bottom: 20px;
}
.shop-section h3 {
border-bottom: 1px solid #555;
padding-bottom: 5px;
margin-top: 0;
}
.shop-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 5px;
padding: 5px;
background: rgba(255, 255, 255, 0.05);
}
.shop-item button {
background: #333;
color: white;
border: 1px solid #555;
padding: 2px 5px;
cursor: pointer;
font-family: inherit;
}
.shop-item button:hover {
background: #555;
}
.close-shop {
position: absolute;
top: 5px;
right: 5px;
background: none;
border: none;
color: white;
font-size: 20px;
cursor: pointer;
}
/* Override for buttons inside shop */
.shop-container .shop-btn {
position: static;
display: block;
width: 100%;
margin-bottom: 5px;
background: #333;
text-align: left;
}
.shop-container .shop-btn:hover {
background: #555;
}
.shop-container .close-btn {
text-align: center;
background: #d32f2f;
border-color: #b71c1c;
}
.shop-container .close-btn:hover {
background: #f44336;
}
</style>
<!-- END_STYLES -->
<!-- START_SCRIPTS_DEFER -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/shaders/CopyShader.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/shaders/SSAOShader.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/EffectComposer.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/RenderPass.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/ShaderPass.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/postprocessing/SSAOPass.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/shaders/GammaCorrectionShader.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.128.0/examples/js/math/SimplexNoise.js" defer></script>
<script src="mining.js" defer></script>
<!-- END_SCRIPTS_DEFER -->
<div class="mining-container">
<div class="mining-ui">
<div class="mining-stat">Depth: <span id="depth-counter">0</span></div>
<div class="mining-stat">Score: <span id="score-counter">0</span></div>
</div>
<button id="shop-btn" class="shop-btn" onclick="toggleShop()">Shop</button>
<div id="shop-modal" class="shop-container" style="display:none; flex-direction:column; max-height: 80vh; overflow-y: auto;">
<div id="shop-content"></div>
</div>
<div id="inventory-display" class="inventory-container">
<!-- Slots will be added here dynamically -->
</div>
<div id="crafting-display" class="crafting-container">
<!-- Crafting slots will be added here dynamically -->
</div>
<canvas id="game-canvas"></canvas>
</div>

View File

@@ -27,5 +27,6 @@
<a href="https://lit.ruv.wtf/materials/" target="_blank">UE Material Snippets</a> <a href="https://lit.ruv.wtf/materials/" target="_blank">UE Material Snippets</a>
<a href="https://lit.ruv.wtf/docs/" target="_blank">Documentation</a> <a href="https://lit.ruv.wtf/docs/" target="_blank">Documentation</a>
<a href="https://lit.ruv.wtf/numbermatch/">Number Match</a> <a href="https://lit.ruv.wtf/numbermatch/">Number Match</a>
<a href="https://lit.ruv.wtf/mining/">Mining Game</a>
</div> </div>
</header> </header>

View File

@@ -8,7 +8,7 @@
<meta name="description" content="<!-- ::META_DESCRIPTION:: -->"> <meta name="description" content="<!-- ::META_DESCRIPTION:: -->">
<meta name="author" content="Litruv"> <meta name="author" content="Litruv">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; worker-src 'self' blob:; <!-- ::PAGE_CSP_OTHER_DIRECTIVES:: -->"> <meta http-equiv="Content-Security-Policy" content="<!-- ::PAGE_CSP:: -->">
<meta property="og:title" content="<!-- ::OG_TITLE:: -->"> <meta property="og:title" content="<!-- ::OG_TITLE:: -->">
<meta property="og:description" content="<!-- ::OG_DESCRIPTION:: -->"> <meta property="og:description" content="<!-- ::OG_DESCRIPTION:: -->">

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

BIN
website/blocks/beacon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

BIN
website/blocks/bedrock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

BIN
website/blocks/brick.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

BIN
website/blocks/cake_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

BIN
website/blocks/clay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

BIN
website/blocks/coal_ore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

BIN
website/blocks/deadbush.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

BIN
website/blocks/dirt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Some files were not shown because too many files have changed in this diff Show More