|
|
@ -45,6 +45,9 @@ export default class ChaseScene extends BaseScene { |
|
|
private retryButton = new Graphics(); |
|
|
private retryButton = new Graphics(); |
|
|
private newGameButton = new Graphics(); |
|
|
private newGameButton = new Graphics(); |
|
|
private restartButton = new Graphics(); |
|
|
private restartButton = new Graphics(); |
|
|
|
|
|
private retryLabel = new Text({ text: "" }); |
|
|
|
|
|
private newGameLabel = new Text({ text: "" }); |
|
|
|
|
|
private restartLabel = new Text({ text: "" }); |
|
|
private seedInputElement?: HTMLInputElement; |
|
|
private seedInputElement?: HTMLInputElement; |
|
|
private readonly documentRef?: DocumentLike; |
|
|
private readonly documentRef?: DocumentLike; |
|
|
private selectedDifficulty: Difficulty = "normal"; |
|
|
private selectedDifficulty: Difficulty = "normal"; |
|
|
@ -336,7 +339,8 @@ export default class ChaseScene extends BaseScene { |
|
|
this.retryButton.roundRect(0, 0, 86, 34, 8); |
|
|
this.retryButton.roundRect(0, 0, 86, 34, 8); |
|
|
this.retryButton.fill({ color: 0x2563eb, alpha: 0.95 }); |
|
|
this.retryButton.fill({ color: 0x2563eb, alpha: 0.95 }); |
|
|
this.resultOverlay.addChild(this.retryButton); |
|
|
this.resultOverlay.addChild(this.retryButton); |
|
|
this.resultOverlay.addChild(this.createOverlayLabel("重试", 43, 59)); |
|
|
this.retryLabel = this.createOverlayLabel("重试", 43, 59); |
|
|
|
|
|
this.resultOverlay.addChild(this.retryLabel); |
|
|
|
|
|
|
|
|
this.newGameButton.eventMode = "static"; |
|
|
this.newGameButton.eventMode = "static"; |
|
|
this.newGameButton.cursor = "pointer"; |
|
|
this.newGameButton.cursor = "pointer"; |
|
|
@ -346,7 +350,8 @@ export default class ChaseScene extends BaseScene { |
|
|
this.newGameButton.roundRect(0, 0, 96, 34, 8); |
|
|
this.newGameButton.roundRect(0, 0, 96, 34, 8); |
|
|
this.newGameButton.fill({ color: 0x0ea5e9, alpha: 0.95 }); |
|
|
this.newGameButton.fill({ color: 0x0ea5e9, alpha: 0.95 }); |
|
|
this.resultOverlay.addChild(this.newGameButton); |
|
|
this.resultOverlay.addChild(this.newGameButton); |
|
|
this.resultOverlay.addChild(this.createOverlayLabel("新一局", 146, 59)); |
|
|
this.newGameLabel = this.createOverlayLabel("新一局", 146, 59); |
|
|
|
|
|
this.resultOverlay.addChild(this.newGameLabel); |
|
|
|
|
|
|
|
|
this.restartButton.eventMode = "static"; |
|
|
this.restartButton.eventMode = "static"; |
|
|
this.restartButton.cursor = "pointer"; |
|
|
this.restartButton.cursor = "pointer"; |
|
|
@ -356,7 +361,8 @@ export default class ChaseScene extends BaseScene { |
|
|
this.restartButton.roundRect(0, 0, 108, 34, 8); |
|
|
this.restartButton.roundRect(0, 0, 108, 34, 8); |
|
|
this.restartButton.fill({ color: 0x22c55e, alpha: 0.95 }); |
|
|
this.restartButton.fill({ color: 0x22c55e, alpha: 0.95 }); |
|
|
this.resultOverlay.addChild(this.restartButton); |
|
|
this.resultOverlay.addChild(this.restartButton); |
|
|
this.resultOverlay.addChild(this.createOverlayLabel("重新开始", 54, 59)); |
|
|
this.restartLabel = this.createOverlayLabel("重新开始", 54, 59); |
|
|
|
|
|
this.resultOverlay.addChild(this.restartLabel); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private createOverlayLabel(text: string, x: number, y: number): Text { |
|
|
private createOverlayLabel(text: string, x: number, y: number): Text { |
|
|
@ -461,15 +467,21 @@ export default class ChaseScene extends BaseScene { |
|
|
if (status === "win") { |
|
|
if (status === "win") { |
|
|
this.resultText.text = "成功逃脱!"; |
|
|
this.resultText.text = "成功逃脱!"; |
|
|
this.restartButton.visible = true; |
|
|
this.restartButton.visible = true; |
|
|
|
|
|
this.restartLabel.visible = true; |
|
|
this.retryButton.visible = false; |
|
|
this.retryButton.visible = false; |
|
|
|
|
|
this.retryLabel.visible = false; |
|
|
this.newGameButton.visible = false; |
|
|
this.newGameButton.visible = false; |
|
|
|
|
|
this.newGameLabel.visible = false; |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.resultText.text = loseReason === "trapped" ? "你已无路可走" : "你被抓住了"; |
|
|
this.resultText.text = loseReason === "trapped" ? "你已无路可走" : "你被抓住了"; |
|
|
this.restartButton.visible = false; |
|
|
this.restartButton.visible = false; |
|
|
|
|
|
this.restartLabel.visible = false; |
|
|
this.retryButton.visible = true; |
|
|
this.retryButton.visible = true; |
|
|
|
|
|
this.retryLabel.visible = true; |
|
|
this.newGameButton.visible = true; |
|
|
this.newGameButton.visible = true; |
|
|
|
|
|
this.newGameLabel.visible = true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private canRunEndAction(): boolean { |
|
|
private canRunEndAction(): boolean { |
|
|
|