diff --git a/js/world.js b/js/world.js index 2106d85..288a0d4 100644 --- a/js/world.js +++ b/js/world.js @@ -42,8 +42,8 @@ function getOrCreateChunk(chunkX, chunkY) { } } - // Add floor at the bottom of the world (y = 0 and y = 1) - if (chunkY === 0 || chunkY === 1) { + // Add floor at the bottom of the world (only at y = 0) + if (chunkY === 0) { // Fill the bottom row with walls for (let x = 0; x < CHUNK_SIZE; x++) { chunkData[(CHUNK_SIZE - 1) * CHUNK_SIZE + x] = WALL; @@ -386,9 +386,9 @@ function setPixel(worldX, worldY, type) { } function getPixel(worldX, worldY) { - // Special case: floor at the bottom of the world (first two chunks) + // Special case: floor at the bottom of the world (only first chunk) const floorChunkY = Math.floor(worldY / CHUNK_SIZE); - if (worldY % CHUNK_SIZE === CHUNK_SIZE - 1 && (floorChunkY === 0 || floorChunkY === 1)) { + if (worldY % CHUNK_SIZE === CHUNK_SIZE - 1 && floorChunkY === 0) { return WALL; }