Day 8: Animations and UI

Development time: 1.5 hours (plus ~30 minutes saved by copying the volume slider code)

I didn't think the ship should explode when it ran out of energy, so I created a new "out of energy" sound effect using BFXR and cleaned it up in Audacity.  I coded a new function to handle running out of energy, and played the sound effect along with a new ship spinning animation.  I think it gives the player a better clue that the ship didn't collide with anything.

I removed the text showing how many ships were remaining and instead added a new function that would draw the number of ships left minus one (because the one at the bottom of the screen that's currently in play counts as a life).

I added a settings screen so the user can control the volumes of both the background music and the sound effects.  The code for the volume controls was taken from a tutorial that I wrote a few years ago that's still relevant:

Next: Day 9

Get Asteroid Blasteroid

Download NowName your own price

Leave a comment

Log in with to leave a comment.