2
\$\begingroup\$

How do I stop a looping music file from playing in crafty.js? I want the music to stop playing once a gameover condition has been reached.

\$\endgroup\$
  • \$\begingroup\$ possible duplicate of Gameover scene transition \$\endgroup\$ – Anko Apr 19 '13 at 10:45
  • \$\begingroup\$ I think the duplicate is the other way around. \$\endgroup\$ – MichaelHouse Apr 19 '13 at 16:20
2
\$\begingroup\$

According to this issue page: Crafty.audio.stop("soundname"); or Crafty.audio.stop() to stop all sounds. Apparently the documentation is very out of date. The issue linked is from 10 months ago, and the documentation is still out of date.

However, you can always check the source code to see what's available to you.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I agree that the documentation is out of date. I'll start using the source code as documentation from now on. I'll probably ask fewer questions too. \$\endgroup\$ – gnerkus Apr 17 '13 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.