diff options
Diffstat (limited to 'src/engine/radio.js')
-rw-r--r-- | src/engine/radio.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/radio.js b/src/engine/radio.js new file mode 100644 index 0000000..d39524a --- /dev/null +++ b/src/engine/radio.js @@ -0,0 +1,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() + } +} |