fix: Optimize player spawn, camera zoom, and performance to reduce lag

This commit is contained in:
Kacper Kostka (aider)
2025-04-05 18:06:39 +02:00
parent 85a96f153f
commit ad90b9320f
3 changed files with 15 additions and 10 deletions

View File

@@ -9,8 +9,8 @@ function render() {
// Draw animated sky background
renderSky();
// Get visible chunks
const visibleChunks = getVisibleChunks();
// Get visible chunks - limit the number of chunks processed per frame
const visibleChunks = getVisibleChunks().slice(0, 20);
// Render each visible chunk
for (const { chunkX, chunkY, isVisible } of visibleChunks) {