ftsf / nico

a Game Framework in Nim inspired by Pico-8.
MIT License
630 stars 36 forks source link

Audio bug w/js - Music not playing, infinite sfx #28

Closed avahe-kellenberger closed 4 years ago

avahe-kellenberger commented 4 years ago

When compiling this project for the web, the music is not played, and the ending sound effect (when you die) is played infinitely and the game doesn't progress. This could be some other compilation related bug, that doesn't have to do with audio.

Try the game locally first to see how it should behave, because it works natively.

ftsf commented 4 years ago

This is two separate issues,

  1. Music not playing on start on JS backend, this is a platform limitation for WebAudio to stop it autoplaying on start. It can be solved but It will require changes per game, perhaps triggering music playing after pressing a button on the title screen for example. It's not something we can really solve generically in nico without obtrusive changes, so I think the best solve is documentation.

  2. The issue is caused by a bug in music(channel, -1) which is fixed by @beef331's PR https://github.com/ftsf/nico/pull/29 thanks!