feat: add random rotation to 4x4 rooms for visual variety

This commit is contained in:
2025-12-29 21:57:56 +01:00
parent 75cf63f906
commit 8502f70bda

View File

@@ -1593,6 +1593,14 @@ async function renderRoom(room) {
tileMesh.position.z = originPos.z + (worldHeight / 2) - (CONFIG.CELL_SIZE / 2);
tileMesh.position.y = 0;
// Random rotation for 4x4 rooms to add variety
if (tileDef.id.includes('room_4x4')) {
const rotations = [0, Math.PI / 2, Math.PI, Math.PI * 1.5];
const randomRotation = rotations[Math.floor(Math.random() * rotations.length)];
tileMesh.rotation.z = randomRotation;
console.log(`[DEBUG] Room ${room.id} rotated ${(randomRotation * 180 / Math.PI).toFixed(0)}°`);
}
console.log(`[DEBUG] renderRoom ${room.id} | MeshPos:`, tileMesh.position);
scene.add(tileMesh);