Day 9: If an Asteroid Explodes in Space and No One is Around to Hear It, Does It Make a Sound?

Brittany Lumanlan Martin
2 min readDec 4, 2020

It sure does in Galaxy Shooter, because the asteroid is attached to a script coded to play an audio clip upon being impacted by a laser. As it should.

The asteroid in question.

After spending the morning reviewing previous modules and sorting out bugs in my code, I cleared out my console of warning and error messages. With all sprites animated, texts updating, and spaceships moving at intended speeds, I moved into the “Game Audio” section.

Just as in “Post Processing”, adding audio brought the game to a new level. When I think of iconic game soundtracks from my childhood, Pokemon Red/Blue and Legend of Zelda: Ocarina of Time come to mind. Two of my favorites from those games are the haunting ‘Lavender Town Theme’ and suspiciously upbeat ‘Lost Woods’ (cheery music coupled with a Club Moblin charging you is jarring when you’re six years old). I enjoyed this section and went through it with confidence until the very end in the “Powerup Sound Challenge”. It was a little tricky to figure out how to initiate the powerup sound as the player collects them, but ultimately it comes down to choosing the correct method.

This is the method used to communicate with the audio source to play the “powerup” clip as the player collects a powerup.

At this point I’ve got a fully functional game on my hands and am on the “Deployment (Build Your Game)” section, getting ready to set it up for Web GL compatibility. It’s a very exciting time and I’ll be sure to post a clip of gameplay after completing the next section, “Galaxy Shooter Extras”.

--

--