Visual: randomise tile column depth for organic terrain feel
Each placeholder tile box is assigned a random visual height between 0.8 and 1.0. The mesh is shifted downward so the TOP surface stays fixed at world Y=0.5 — collision shapes, unit y_offsets, and highlight positions are all unchanged. The variation shows as more or less tile-side visible from the camera angle, giving the grid an uneven, terrain-like appearance. 3D tile models (when loaded) replace the placeholder mesh and are unaffected. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -458,9 +458,14 @@ func _add_tile(x: int, y: int, affinity: String) -> void:
|
||||
body.add_child(shape)
|
||||
|
||||
# Placeholder: affinity-coloured flat box, swapped out if a 3D model loads.
|
||||
# Visual height varies per tile (0.8–1.0) for organic terrain feel.
|
||||
# The mesh is shifted downward so the TOP surface always stays at Y=0.5 in
|
||||
# world space — collision shape, unit positions, and highlights are unaffected.
|
||||
var vis_h : float = randf_range(0.8, 1.0)
|
||||
var mi := MeshInstance3D.new()
|
||||
var bm := BoxMesh.new()
|
||||
bm.size = Vector3(0.98, 0.5, 0.98)
|
||||
bm.size = Vector3(0.98, vis_h, 0.98)
|
||||
mi.position = Vector3(0, (0.5 - vis_h) * 0.5, 0) # shift down to keep top at body-local +0.25
|
||||
mi.mesh = bm
|
||||
var mat := StandardMaterial3D.new()
|
||||
mat.albedo_color = AFFINITY_COLORS.get(affinity, Color(0.2, 0.2, 0.2))
|
||||
|
||||
Reference in New Issue
Block a user