Reset reusable level state between room visits

This commit is contained in:
Admin 2026-09-22 01:48:54 +00:00
parent 4e0d0a6efe
commit 3889190e88

View File

@ -1260,6 +1260,10 @@ class HouseScene extends Phaser.Scene {
class PlayableLevelScene extends Phaser.Scene {
constructor(key) {
super(key)
this.resetLevelRuntime()
}
resetLevelRuntime() {
this.playerDragging = false
this.playerDragTargetX = null
this.lastDragX = null
@ -1475,6 +1479,7 @@ class RoomScene extends PlayableLevelScene {
}
init(data) {
this.resetLevelRuntime()
this.roomId = data?.roomId ?? 'living'
}
@ -1565,6 +1570,10 @@ class RoofScene extends PlayableLevelScene {
super('RoofScene')
}
init() {
this.resetLevelRuntime()
}
create() {
const worldWidth = 2900
const groundY = 1370
@ -1639,7 +1648,7 @@ const game = new Phaser.Game({
})
window.__DOLLHOUSE__ = {
version: '0.12.0',
version: '0.12.1',
game,
async resetAll() {
await clearGameState()