summaryrefslogtreecommitdiff
path: root/src/engine/radio.js
blob: d39524a17942434c0646833a8f3a555ed6b14631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export class Radio {
    bgm
    playMusic(file) {
        if (this.bgm != undefined) this.bgm.pause()
        this.bgm = new Audio(file)
        this.bgm.play()
        this.bgm.loop = true
    }

    playSound(file) {
        let audio = new Audio(file)
        audio.play()
    }
}