a munch adventure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
581 B

  1. "use strict"
  2. let audioContext;
  3. // setup the game
  4. function init() {
  5. initAudio();
  6. document.querySelector("#load").addEventListener("click", () => {
  7. loadAudio("sfx/test.ogg");
  8. loadAudio("loop/test.ogg");
  9. });
  10. document.querySelector("#sfx").addEventListener("click", () => {
  11. playSfx("sfx/test.ogg");
  12. });
  13. document.querySelector("#loop").addEventListener("click", () => {
  14. playLoop("loop/test.ogg");
  15. });
  16. document.querySelector("#stop").addEventListener("click", () => {
  17. stopLoop("loop/test.ogg");
  18. });
  19. }
  20. window.addEventListener("load", init);