a munch adventure
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

30 wiersze
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);