You are browsing as a guest. Sign up (or log in) to start making projects!

3h 11m 51s logged

Sound effects!

I added sound effects to the game UI. A unique sound plays for each of these:

  • Starting a game
  • Dragging a quark over a chamber
  • Dropping a quark onto a chamber
  • A quark hadronizing
  • A quark tunneling
  • Winning a game
  • Closing a game

I sourced them all from https://freesound.org/, and I left attribution for each one in sounds.svelte.ts. I also modified a few in Audacity to trim them or apply simple effects.

I’m not sure that I’m 100% satisfied with the sounds. I sourced almost all of the effects from different freesound sounds because I couldn’t find a sound pack that I liked, so the sounds don’t quite match tonally. Some of them are generic UI sounds while others are clearly scifi-ey. I may change some of the sounds later if I find more cohesive ones.

I’d never done audio in HTML/JS before, so this was new for me. I originally just used the Audio() constructor because that was the most obvious way to play, but when I realized the many issues with it (though it did work!), I rewrote my code to use AudioContext. I also made a multi-step preloading and decoding pipeline that fetches all sound effects on page load, but doesn’t decode them until the user presses a button because otherwise JS throws a warning in the console and suspends the audio context.

I think that the sound effects make Hadronize feel a lot more polished and nicer to play.

Next up on my list is mobile support. I’m not looking forward to it.

(Make sure to turn on sound for the video below)

0
6

Comments 0

No comments yet. Be the first!