Replace repeated room tiling with fitted bays
This commit is contained in:
parent
1cc43040e9
commit
0aeaaabae7
58
src/main.js
58
src/main.js
@ -1501,22 +1501,36 @@ class RoomScene extends PlayableLevelScene {
|
||||
graphics.fillStyle(0xfffbfd, 1)
|
||||
graphics.fillRect(0, 110, worldWidth, floorBottom - 110)
|
||||
|
||||
this.add.tileSprite(
|
||||
worldWidth / 2,
|
||||
wallTop + (floorTop - wallTop) / 2,
|
||||
worldWidth,
|
||||
floorTop - wallTop,
|
||||
skin.wallpaper
|
||||
).setDepth(1)
|
||||
// Use three large fitted bays instead of TileSprite repetition. The source
|
||||
// artwork is close to the bay aspect ratio, so this keeps motifs/planks
|
||||
// readable and the joins can be hidden by the room dividers.
|
||||
const bayCount = 3
|
||||
const bayWidth = worldWidth / bayCount
|
||||
const wallHeight = floorTop - wallTop
|
||||
const floorHeight = floorBottom - floorTop
|
||||
|
||||
// Long floor strip.
|
||||
this.add.tileSprite(
|
||||
worldWidth / 2,
|
||||
floorTop + (floorBottom - floorTop) / 2,
|
||||
worldWidth,
|
||||
floorBottom - floorTop,
|
||||
skin.floor
|
||||
).setDepth(2)
|
||||
for (let bay = 0; bay < bayCount; bay += 1) {
|
||||
const x = bayWidth * bay + bayWidth / 2
|
||||
const flip = bay % 2 === 1
|
||||
|
||||
this.add.image(
|
||||
x,
|
||||
wallTop + wallHeight / 2,
|
||||
skin.wallpaper
|
||||
)
|
||||
.setDisplaySize(bayWidth + 8, wallHeight)
|
||||
.setFlipX(flip)
|
||||
.setDepth(1)
|
||||
|
||||
this.add.image(
|
||||
x,
|
||||
floorTop + floorHeight / 2,
|
||||
skin.floor
|
||||
)
|
||||
.setDisplaySize(bayWidth + 8, floorHeight)
|
||||
.setFlipX(flip)
|
||||
.setDepth(2)
|
||||
}
|
||||
|
||||
// Rear skirting and front floor edge run the whole stage.
|
||||
this.add.image(worldWidth / 2, floorTop, 'architecture-skirting')
|
||||
@ -1531,10 +1545,14 @@ class RoomScene extends PlayableLevelScene {
|
||||
.setDisplaySize(worldWidth, 32)
|
||||
.setDepth(6)
|
||||
|
||||
// Break the long room into visible bays without blocking movement.
|
||||
graphics.lineStyle(5, 0xd7b4c6, 0.42)
|
||||
for (let x = 720; x < worldWidth; x += 720) {
|
||||
graphics.lineBetween(x, wallTop + 20, x, floorTop - 10)
|
||||
// Architectural joins hide the panel boundaries and make the long level
|
||||
// read as three connected dollhouse bays rather than repeated tiles.
|
||||
for (let x = bayWidth; x < worldWidth; x += bayWidth) {
|
||||
graphics.fillStyle(0xfff6f0, 1)
|
||||
graphics.fillRoundedRect(x - 13, wallTop, 26, floorBottom - wallTop, 8)
|
||||
|
||||
graphics.lineStyle(4, 0xd7b4c6, 0.9)
|
||||
graphics.lineBetween(x, wallTop + 8, x, floorBottom - 8)
|
||||
}
|
||||
|
||||
// Left/right end caps.
|
||||
@ -1648,7 +1666,7 @@ const game = new Phaser.Game({
|
||||
})
|
||||
|
||||
window.__DOLLHOUSE__ = {
|
||||
version: '0.12.2',
|
||||
version: '0.12.3',
|
||||
game,
|
||||
async resetAll() {
|
||||
await clearGameState()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user