Making my second game - Sound
(Part 2 - Finale)

Making my second game - Sound<br> (Part 2 - Finale)

If you haven’t yet, please read Part 1.

Spectrum Attack is done!

The second monthly project is now over.

This was a rough month. So this will be the only update of the month for Spectrum Attack!

The Twist (again)

If you read the last devlog of April then you already know that I caught Covid-19. And it sucked… I thought it was going to be a walk in the park, because of vaccines and stuff. Oh boy, how wrong I was…

I ended up having symptoms for a total of four weeks, which didn’t allow me to stay at the computer for more than a couple minutes of a time, since I would get very nauseous.

So basically, everything related to this game was done in the last couple of days.

I thought about postponing this month’s project to June, but that meant to break my initial promise after only one month, so I pushed through it.

Overall, I think it still payed off.

The Game

I finished Part 1 being somewhat vague on what the game would be about. I stated that the game would feature its Music as the main gameplay element and I was able to keep that promise!

Spectrum Attack! is a game about a cat that either loves or hates rain! Roll your way around while the music plays and either grab or avoid the rain drops.

Tasks

Spectrum Analyzer

I started by implement an analyzer that would give me a histrogram of the different sound frequencies that were being played. Fortunately, this was very easy since Godot provides a very easy-to-use API exactly for this.

After having it working, I refactored it in order to give me the notes which were being played, no matter what octave it was. Basically, summing every 12nd interval in its own group.

Since notes being played on top of the others create lots of frequency noise, I decided accumulate these samples and only query which notes were being played a handful times per second.

Falling Rain

Querying the previous accumulated samples gives me numbers from 0 to 11 (A, A#, B, C, C#, D, D#, E, F, F#, G, G#).

I divide the screen in 12 vertical strips and then spawn rain-drops in the corresponding slot for the notes that are being played at that exact time.

Rolling Cat

Now, it’s just a matter of implementing a player entity for us to control!

I decided on a cute cat that rolls around trying to avoid the rain. For this, I just move it left and right and apply an adequate rotation speed.

Since straight-falling rain was too easy, I make sure the rain falls always in the direction where the player is, for added difficulty.

UI

I came up with a very simple UI, since time was short.

On the main menu there are two buttons, for two different game modes: either collect the rain drops, or avoid them.

I have a timer to tell how much until the round ends. I also keep track of the player score and show a “damage” indicator when the score is decreased.

Art / Music

None of the art (background, cat, rain-drops) was done by me. My contribution for this game is strictly the entire code on it.

I really wanted to make my own assets, but I wasn’t on a physical or mental state necessary to do it.

That’s it for May!

May had its ups and downs, but I finished game number two!

Here is the project page for Spectrum Attack! Give it a look and, preferably, a play!

I’ll see you next month!


© 2022. All rights reserved.