refactor: Optimize terrain rendering and zooming performance

This commit is contained in:
Kacper Kostka
2025-04-02 12:28:21 +02:00
parent a4ef5e0f40
commit ae26d93432
4 changed files with 55 additions and 16 deletions

View File

@@ -182,6 +182,7 @@ function isWater(x, y) {
// Get terrain type at a position
function getTerrainType(x, y) {
// Convert world coordinates to terrain grid coordinates
// Use consistent rounding to prevent shaking
const gridX = Math.floor((x + 2000) / 10);
const gridY = Math.floor((y + 2000) / 10);