JoshuaKGoldberg / ChooseYourFramework

Choosing a modern JavaScript UI framework, Pokemon-style.
https://chooseyourframework.dev
MIT License
70 stars 6 forks source link

🚀 Feature: Background music and menu sound effects #25

Open zernonia opened 2 years ago

zernonia commented 2 years ago

I know adding sound effect is tricky since the app starts right away, and browser requires user interaction before playing audio. Not sure "WASD" keypress consider interaction or not 🤔

But this is just a "good to have" features 😁

JoshuaKGoldberg commented 2 years ago

Thanks for suggesting this @zernonia - agreed, audio would be great! WASD keypresses should count, yes - so maybe the background music can fade in when the user first moves?

One more caveat to consider is that the game has a tight (arbitrary, chosen by me on a whim) performance budget of 256 kB total size on the page uncompressed. I suppose we could go over for audio that's lazy-loaded... but whatever audio happens should be very compressed.

EightBittr does have a package already for playing audio: AudioPlayr. https://github.com/FullScreenShenanigans/EightBittr/tree/main/packages/audioplayr