summaryrefslogtreecommitdiff
path: root/boot.js
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-10-22 21:39:32 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-10-22 21:39:32 -0400
commit2cfd7a3a98260a14cfd50f5f496b416da402eb05 (patch)
tree958b7c24e5fa90d593c2bab408c6333c5c899070 /boot.js
parent89db62cd6c3db6b0df829d881ba606ab90c0170c (diff)
Add a bunch of sound effects.
Diffstat (limited to 'boot.js')
-rw-r--r--boot.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/boot.js b/boot.js
index 161a4d9..0d88a1f 100644
--- a/boot.js
+++ b/boot.js
@@ -63,6 +63,9 @@ async function load() {
},
removeEventListener(elem, name, proc) {
elem.removeEventListener(name, wrapProc(proc));
+ },
+ clone(elem) {
+ return elem.cloneNode();
}
},
event: {
@@ -95,6 +98,20 @@ async function load() {
setImageSmoothingEnabled(context, enabled) {
context.imageSmoothingEnabled = (enabled == 1);
}
+ },
+ audio: {
+ new(src) {
+ return new Audio(src);
+ },
+ play(audio) {
+ audio.play();
+ },
+ volume(audio) {
+ return audio.volume;
+ },
+ setVolume(audio, vol) {
+ audio.volume = vol;
+ }
}
});
const scheme = await mod.reflect();