feat(hud): compass + depth + biome indicator

Panneau info top-right avec boussole (8 directions FR), profondeur
en mètres depuis la surface, et nom de biome courant (Récif Corallien,
Forêt de Kelp, Plateau Rocheux, Abysses). Helper biome_name_at dans
WorldGenerator pour requête client-side sans relire les chunks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-20 17:58:19 +00:00
parent 63500148db
commit df63dec39b
2 changed files with 131 additions and 0 deletions

View File

@@ -64,6 +64,30 @@ static func _get_biome(biome_val: float, ground_height: int) -> int:
else:
return 3
const BIOME_NAMES: PackedStringArray = PackedStringArray([
"Récif Corallien",
"Forêt de Kelp",
"Plateau Rocheux",
"Abysses"
])
static func biome_at(world_x: float, world_z: float, seed_val: int) -> int:
var noise_biome: FastNoiseLite = FastNoiseLite.new()
noise_biome.seed = seed_val + 1337
noise_biome.noise_type = FastNoiseLite.TYPE_SIMPLEX_SMOOTH
noise_biome.frequency = 0.004
var biome_val: float = noise_biome.get_noise_2d(world_x, world_z)
return _get_biome(biome_val, 0)
static func biome_name_at(world_x: float, world_z: float, world_y: float, seed_val: int) -> String:
if world_y < -40.0:
return BIOME_NAMES[3]
var b: int = biome_at(world_x, world_z, seed_val)
return BIOME_NAMES[b]
static func _get_block_at(wy: int, ground_height: int, biome: int,
wx: int, wz: int, lx: int, lz: int,
is_wreck_center: bool, noise_detail: FastNoiseLite, noise_glow: FastNoiseLite, seed: int) -> int: