feat: Prevent placing entities on water and improve land generation

This commit is contained in:
Kacper Kostka (aider)
2025-04-02 12:14:34 +02:00
parent cde5301c2b
commit 3fa8a695b3
6 changed files with 113 additions and 13 deletions

View File

@@ -109,8 +109,8 @@ function generateTerrain(width, height, scale) {
value /= 1.75; // Normalize
// Determine terrain type based on noise value
// Increase water threshold to create more water areas
if (value < 0.0) {
// Lower water threshold to create more land areas
if (value < -0.3) { // Changed from 0.0 to -0.3 to reduce water
terrain[x][y] = TERRAIN_WATER;
} else {
terrain[x][y] = TERRAIN_GRASS;