feat(enemies): 实现怪物基类与4种怪物及波次管理器
This commit is contained in:
24
game/enemies/FreshGraduate.ts
Normal file
24
game/enemies/FreshGraduate.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type Phaser from 'phaser'
|
||||
import { EnemyBase, type PathPoint } from './EnemyBase'
|
||||
|
||||
const QUOTES = ['求转正!', '我愿意加班!', '卷!卷!卷!']
|
||||
|
||||
export class FreshGraduate extends EnemyBase {
|
||||
constructor(scene: Phaser.Scene, pathPoints: PathPoint[]) {
|
||||
super(scene, pathPoints, 30, 120, 2, 10)
|
||||
this.drawSprite()
|
||||
}
|
||||
|
||||
drawSprite(): void {
|
||||
if (!this.sprite) return
|
||||
this.sprite.clear()
|
||||
this.sprite.fillStyle(0x86efac, 1)
|
||||
this.sprite.fillCircle(0, 0, 8)
|
||||
this.sprite.setDepth(10)
|
||||
this.sprite.setPosition(this.x, this.y)
|
||||
}
|
||||
|
||||
getQuote(): string {
|
||||
return QUOTES[Math.floor(Math.random() * QUOTES.length)]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user