fix(game): 修复格子正方形和图片尺寸问题,用setDisplaySize精确控制角色图片占一格
This commit is contained in:
@@ -6,9 +6,8 @@ export class OldEmployee extends EnemyBase {
|
||||
constructor(scene: Phaser.Scene, pathPoints: PathPoint[]) {
|
||||
super(scene, pathPoints, 150, 50, 8, 30, 'enemy-old')
|
||||
this.shieldCount = 3
|
||||
// 老员工图片稍大
|
||||
const scale = Math.min(this.cellW, this.cellH) / 128 * 0.9
|
||||
this.imageSprite.setScale(scale)
|
||||
// 老员工比普通怪略大(0.85 个格子)
|
||||
this.imageSprite.setDisplaySize(this.cellW * 0.85, this.cellW * 0.85)
|
||||
}
|
||||
|
||||
getQuote(): string { return getRandomQuote('OldEmployee') }
|
||||
|
||||
Reference in New Issue
Block a user