mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
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:
13
index.html
13
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}`;
|
||||
|
||||
Reference in New Issue
Block a user