feat: Improve stone layer visibility and rendering
This commit is contained in:
16
js/render.js
16
js/render.js
@@ -49,7 +49,21 @@ function render() {
|
||||
const index = y * CHUNK_SIZE + x;
|
||||
const type = chunk[index];
|
||||
|
||||
if (type === EMPTY) continue;
|
||||
// Always render stone layer even if it's not directly visible
|
||||
if (type === EMPTY && chunkY !== 1) continue;
|
||||
|
||||
// For the stone layer (chunkY = 1), render a faint background even for empty spaces
|
||||
if (type === EMPTY && chunkY === 1) {
|
||||
// Use a very faint gray for empty spaces in the stone layer
|
||||
ctx.fillStyle = 'rgba(100, 100, 100, 0.2)';
|
||||
ctx.fillRect(
|
||||
screenX + x * PIXEL_SIZE,
|
||||
screenY + y * PIXEL_SIZE,
|
||||
PIXEL_SIZE,
|
||||
PIXEL_SIZE
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Set color based on type
|
||||
if (type === SAND) {
|
||||
|
||||
Reference in New Issue
Block a user