fix(game): 修复底部塔面板不可见问题,改用React层实现,并用AI素材替换Graphics像素块
This commit is contained in:
@@ -5,49 +5,21 @@ import { getRandomQuote } from '../data/quotes'
|
||||
|
||||
export class TroubleMaker extends EnemyBase {
|
||||
constructor(scene: Phaser.Scene, pathPoints: PathPoint[]) {
|
||||
super(scene, pathPoints, 80, 80, 5, 20)
|
||||
this.drawSprite()
|
||||
}
|
||||
|
||||
drawSprite(): void {
|
||||
if (!this.sprite) return
|
||||
this.sprite.clear()
|
||||
// 三角形(叹号形状)
|
||||
this.sprite.fillStyle(0xfca5a5, 1)
|
||||
this.sprite.fillTriangle(0, -14, -12, 10, 12, 10)
|
||||
// 叹号
|
||||
this.sprite.fillStyle(0x7f1d1d, 1)
|
||||
this.sprite.fillRect(-2, -6, 4, 8)
|
||||
this.sprite.fillRect(-2, 6, 4, 4)
|
||||
this.sprite.setDepth(10)
|
||||
this.sprite.setPosition(this.x, this.y)
|
||||
super(scene, pathPoints, 80, 80, 5, 20, 'enemy-trouble')
|
||||
}
|
||||
|
||||
protected override onDeath(): void {
|
||||
// 劳动仲裁:死亡时扣玩家 20 HC
|
||||
const manager = GameManager.getInstance()
|
||||
manager.spendHC(20)
|
||||
// 显示提示文字
|
||||
GameManager.getInstance().spendHC(20)
|
||||
const txt = this.scene.add
|
||||
.text(this.x, this.y - 20, '劳动仲裁! -20HC', {
|
||||
fontFamily: 'VT323, monospace',
|
||||
fontSize: '16px',
|
||||
color: '#FCA5A5',
|
||||
backgroundColor: '#7F1D1D',
|
||||
padding: { x: 4, y: 2 },
|
||||
})
|
||||
.setOrigin(0.5, 1)
|
||||
.setDepth(25)
|
||||
fontFamily: 'VT323, monospace', fontSize: '16px',
|
||||
color: '#FCA5A5', backgroundColor: '#7F1D1D', padding: { x: 4, y: 2 },
|
||||
}).setOrigin(0.5, 1).setDepth(25)
|
||||
this.scene.tweens.add({
|
||||
targets: txt,
|
||||
y: this.y - 50,
|
||||
alpha: 0,
|
||||
duration: 1500,
|
||||
onComplete: () => txt.destroy(),
|
||||
targets: txt, y: this.y - 50, alpha: 0,
|
||||
duration: 1500, onComplete: () => txt.destroy(),
|
||||
})
|
||||
}
|
||||
|
||||
getQuote(): string {
|
||||
return getRandomQuote('TroubleMaker')
|
||||
}
|
||||
getQuote(): string { return getRandomQuote('TroubleMaker') }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user