From b23cdb838ebbdc64a963920c4681a6ff4a15c57a Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Tue, 29 Apr 2025 00:13:26 +0100 Subject: [PATCH] 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. --- index.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.html b/index.html index 74b1694..f8f105a 100644 --- a/index.html +++ b/index.html @@ -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}`;