fix(game): 修复输了能进下一关的Bug、换关后塔残留、召唤按钮太小、战斗前不能发激励

This commit is contained in:
Cloud Bot
2026-03-24 08:30:03 +00:00
parent d7253c45be
commit 653c54c06f
4 changed files with 53 additions and 23 deletions

View File

@@ -23,25 +23,27 @@ export class HUD {
*/
createWaveButton(onClick: () => void): void {
if (this.waveBtn) this.waveBtn.destroy()
this._onClick = onClick // 保存引用,供 enableWaveButton 重新绑定
this._onClick = onClick
this.waveBtn = this.scene.add
.text(GAME_WIDTH - 160, HUD_HEIGHT + 20, '▶ 召唤下一波', {
fontFamily: "'Press Start 2P', monospace",
fontSize: '9px',
.text(GAME_WIDTH / 2, HUD_HEIGHT + 16, '▶ 召唤下一波', {
fontFamily: 'VT323, monospace',
fontSize: '26px',
color: '#A78BFA',
backgroundColor: '#1e3a5f',
padding: { x: 10, y: 6 },
padding: { x: 20, y: 8 },
stroke: '#7C3AED',
strokeThickness: 1,
})
.setOrigin(0, 0)
.setOrigin(0.5, 0)
.setDepth(20)
.setInteractive({ useHandCursor: true })
this.waveBtn.on('pointerover', () => {
if (this.waveBtn) this.waveBtn.setStyle({ backgroundColor: '#2d5a8e' })
if (this.waveBtn) this.waveBtn.setStyle({ backgroundColor: '#2d5a8e', color: '#C4B5FD' })
})
this.waveBtn.on('pointerout', () => {
if (this.waveBtn) this.waveBtn.setStyle({ backgroundColor: '#1e3a5f' })
if (this.waveBtn) this.waveBtn.setStyle({ backgroundColor: '#1e3a5f', color: '#A78BFA' })
})
this.waveBtn.on('pointerdown', () => onClick())
}