|
|
@ -22,6 +22,11 @@ const snd = document.getElementById("audioplayer"); |
|
|
|
if (!snd) { |
|
|
|
throw "invalid audio player"; |
|
|
|
} |
|
|
|
if (!(snd instanceof HTMLAudioElement)) { |
|
|
|
throw "invalid audio player"; |
|
|
|
} |
|
|
|
|
|
|
|
snd.volume = 0.3; |
|
|
|
|
|
|
|
// get the json file `file_name` and call `callback` with the result
|
|
|
|
const get_json_callback = function(file_name, callback) { |
|
|
@ -125,8 +130,6 @@ const new_game = function (multi) { |
|
|
|
get_json_callback("lvl_01.json", game); |
|
|
|
} |
|
|
|
|
|
|
|
snd.volume = 0.3; |
|
|
|
|
|
|
|
const snd_start = function() { |
|
|
|
snd.currentTime = 0.0; |
|
|
|
snd.play(); |
|
|
|