feat(game): 添加全套音效系统(背景BGM+7种攻击音+波次/Boss/死亡/建塔音效),纯Web Audio API合成
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type Phaser from 'phaser'
|
||||
import { TowerBase } from './TowerBase'
|
||||
import { GameManager } from '../GameManager'
|
||||
import { AudioEngine } from '../AudioEngine'
|
||||
import type { EnemyBase } from '../enemies/EnemyBase'
|
||||
|
||||
export class InternTower extends TowerBase {
|
||||
@@ -32,6 +33,7 @@ export class InternTower extends TowerBase {
|
||||
}
|
||||
|
||||
attack(target: EnemyBase): void {
|
||||
AudioEngine.getInstance().playPunch()
|
||||
const isInstakill = Math.random() < 0.05 && target.hp < 500
|
||||
if (isInstakill) {
|
||||
target.takeDamage(9999)
|
||||
|
||||
Reference in New Issue
Block a user