diff options
author | David Thompson <dthompson2@worcester.edu> | 2023-10-22 21:39:32 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2023-10-22 21:39:32 -0400 |
commit | 2cfd7a3a98260a14cfd50f5f496b416da402eb05 (patch) | |
tree | 958b7c24e5fa90d593c2bab408c6333c5c899070 /boot.js | |
parent | 89db62cd6c3db6b0df829d881ba606ab90c0170c (diff) |
Add a bunch of sound effects.
Diffstat (limited to 'boot.js')
-rw-r--r-- | boot.js | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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(); |