feat: add random rotation to 4x4 rooms for visual variety
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user