diff --git a/script.js b/script.js index 1970ac2..adf73cd 100644 --- a/script.js +++ b/script.js @@ -340,8 +340,8 @@ function setPixel(worldX, worldY, type) { function getPixel(worldX, worldY) { // Special case: floor at the bottom of the world (first two chunks) - const chunkY = Math.floor(worldY / CHUNK_SIZE); - if (worldY % CHUNK_SIZE === CHUNK_SIZE - 1 && (chunkY === 0 || chunkY === 1)) { + const floorChunkY = Math.floor(worldY / CHUNK_SIZE); + if (worldY % CHUNK_SIZE === CHUNK_SIZE - 1 && (floorChunkY === 0 || floorChunkY === 1)) { return WALL; }