Boulder Blaster – Almost there

This is probably the last post about my Boulder Blaster project this year. I’m not done yet, but I have gotten very close. I might get some time to complete it during the holidays, so I can’t say if I failed or succeeded in reaching my goal of making a game this year just yet.

What been done since last time?

I have added sound effects! Other things too, but the sound effects are what I’m most exited about. They are awful, but I love them. They are my attempt to replicate the sound effects you would get from a nineties PC computer that’s missing a sound card, which are highly nostalgic for me.

I had various ideas about sounds effects for the game, but when I discovered that JavaScript could generate different sound waves, including square sounds waves, the same as used by above mentioned PC:s, I knew I had to use that feature.

A Square Wave

As usual, I played around with the JavaScript feature on CodePen before I added sounds to the game. You can check out my experimentation here.

The sound effects are very crude and I suspect that a vast majority of players don’t want to hear them, so I set the sound off as default in the game. Players need to click on the sound icon or press S to toggle the sound on and off.

It was fairly easy to generate the sounds, the only tricky part was to make sure I contained myself to, what I believe is, the constraints of the old PC speaker. Meaning no overlapping sound effects. So each time a sound effect gets triggered, it either has to cancel out the current sound effect, wait for its turn or not play at all.

The other things I have done

Besides sounds effects, the following has been added to the game.

  • Start screen
  • Game over screen
  • Help text (needs improvements though)
  • Score counter (with persistent high score counter)

It is starting to look like a completed game.

The current version of the game can be played here.

Code changes

You can view the code changes, made between last commit before previous blog post and last commit before this, on this page. Unfortunately I have edited a lot of white space so lot of lines are marked as changed.

Besides all the additions added to handle the new stuff, I have fixed a thing that annoyed me since inception. I have decoupled the CollisionHandler class from the ExplosionHandler class and it is no longer responsible for placing the explosions. The GameLogic class is now the part that places explosions on the screen when a collision happens. A minor thing, but it made the code look a bit better.

What is left?

  • Write a better text on the help screen.
  • Write all missing tests.
  • Update the “readme” file on Github.
  • Create a page about the game on the site.
  • Add links to Github and the game page below the game screen.
  • Add Sound tests on CodePen to file in Concepts folder.
  • Post a link to game on at least one location on the Internet (besides this blog).

I also need to add a text about the game is only made to work on a PC and with modern browsers. I don’t care if the game works on mobile devices or older browsers (like IE for example). Something I just now realized I have not made clear on this blog.


Be the first to comment

Leave a Reply

Your email address will not be published.