1

I am making a game with the kaboom library and would like to add background music, i read the docs and found const music = play("music"); music.loop() but this seems to only play it once, the file is an MP3 file and i dont get any errors

Henry
  • 11
  • 4

2 Answers2

0

You can use something like:

const music = play("music", {loop: true});

to loop your music.

0

You can write as following to loop:

loadSound("music", "path/to/music.mp3").then((music) =>{
   music.play({loop:true});
});