From 25adfc618e77db9a5ee3b98ce0dab0be832efed0 Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Tue, 24 Dec 2024 17:58:20 +0100 Subject: hello kitty base done --- src/engine/radio.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/engine/radio.js (limited to 'src/engine/radio.js') 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() + } +} -- cgit v1.2.3