Add scaling for object types in index.html: introduce OBJECT_SCALES to adjust sizes for notes, key, phone, and tablet objects, enhancing visual consistency in the game scenario.

This commit is contained in:
Z. Cliffe Schreuders
2025-04-29 00:13:26 +01:00
parent 64a7415779
commit b23cdb838e

View File

@@ -2384,6 +2384,14 @@
roomObjectsByType[obj.name].push(obj);
});
// Define scale factors for different object types
const OBJECT_SCALES = {
'notes': 0.75,
'key': 0.75,
'phone': 0.75,
'tablet': 0.75
};
// Process scenario objects first
if (gameScenario.rooms[roomId].objects) {
gameScenario.rooms[roomId].objects.forEach((scenarioObj, index) => {
@@ -2432,6 +2440,11 @@
console.log(`Created object ${objType} at random position (${randomX}, ${randomY})`);
}
// Apply scaling based on object type
if (OBJECT_SCALES[objType]) {
sprite.setScale(OBJECT_SCALES[objType]);
}
// SIMPLIFIED NAMING APPROACH
// Use a consistent format: roomId_type_index
const objectId = `${roomId}_${objType}_${index}`;